내 응용 프로그램에서는 탭 레이아웃이있는 경고 상자를 만들고 싶습니다. 경고 상자에 탭 레이아웃을 만들 수 있습니까 ?? 도와주세요. 적절한 해결책을 제시하십시오. 미리 감사드립니다 !!경고 상자에 tablayout 만들기
0
A
답변
0
사용자 지정 알림 대화 상자를 만들 수 있습니다.
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.YOURDIALOGTHEME));
alertDialogBuilder.setCancelable(false);
alertDialogBuilder.setTitle(title);
alertDialogBuilder.setMessage(message);
LayoutInflater factory = LayoutInflater.from(this);
final View alertView = factory.inflate(R.layout.mycustomtabinalert, null);
alertDialogBuilder.setView(alertView);
mycustomtabinalert.xml은 탭 레이아웃을 만들 수있는 레이아웃 파일입니다.
할당 긍정적이고 부정적인 버튼을 탭을 만들기위한 당신의 경고 대화
alertDialogBuilder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
}
}
에 필요에 따라, 당신은 당신이 원하는 것처럼 같은 테이블 레이아웃과 XML을 생성 할 수 있습니다 기사 here
1
을 참조하시기 바랍니다. 다음은 here
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:shrinkColumns="*" android:stretchColumns="*" android:background="#ffffff">
<!-- Row 1 with single column -->
<TableRow
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center_horizontal">
<TextView
android:layout_width="match_parent" android:layout_height="wrap_content"
android:textSize="18dp" android:text="Row 1" android:layout_span="3"
android:padding="18dip" android:background="#b0b0b0"
android:textColor="#000"/>
</TableRow>
<!-- Row 2 with 3 columns -->
<TableRow
android:id="@+id/tableRow1"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<TextView
android:id="@+id/TextView04" android:text="Row 2 column 1"
android:layout_weight="1" android:background="#dcdcdc"
android:textColor="#000000"
android:padding="20dip" android:gravity="center"/>
<TextView
android:id="@+id/TextView04" android:text="Row 2 column 2"
android:layout_weight="1" android:background="#d3d3d3"
android:textColor="#000000"
android:padding="20dip" android:gravity="center"/>
<TextView
android:id="@+id/TextView04" android:text="Row 2 column 3"
android:layout_weight="1" android:background="#cac9c9"
android:textColor="#000000"
android:padding="20dip" android:gravity="center"/>
</TableRow>
<!-- Row 3 with 2 columns -->
<TableRow
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center_horizontal">
<TextView
android:id="@+id/TextView04" android:text="Row 3 column 1"
android:layout_weight="1" android:background="#b0b0b0"
android:textColor="#000000"
android:padding="20dip" android:gravity="center"/>
<TextView
android:id="@+id/TextView04" android:text="Row 3 column 2"
android:layout_weight="1" android:background="#a09f9f"
android:textColor="#000000"
android:padding="20dip" android:gravity="center"/>
</TableRow>
</TableLayout>
에서 테이블 레이아웃의 예를 사용하면 경고 대화 상자에이 XML을 팽창 할 수있다.
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.anyOfYourDialogTheme));
alertDialogBuilder.setCancelable(false);
alertDialogBuilder.setTitle(title);
alertDialogBuilder.setMessage(message);
LayoutInflater mFactory = LayoutInflater.from(this);
View mView = mFactory.inflate(R.layout.CustomTableLayout, null);
alertDialogBuilder.setView(mView);
결과를 확인하고 결과를 알려주십시오.
감사합니다.
관련 문제
- 1. 탭이없는 Android TabLayout; MyFitnessPal 스타일 tablayout 만들기
- 2. TabLayout 측정
- 3. 경고 상자에 AJAX 사용
- 4. 경고 상자에 텍스트 입력
- 5. 경고 상자에 예외 처리
- 6. 경고 대화 상자에 경고 메시지가 표시되지 않습니까?
- 7. 경고 대화 상자에 메시지 표시
- 8. 경고 상자에 변수 값을 표시하려고합니다.
- 9. 경고 상자에 아이콘을 어떻게 추가합니까?
- 10. 경고 상자에 스타일 속성 추가하기
- 11. jquery 객체를 경고 상자에 덤프합니다.
- 12. 경고 상자에 오류 메시지 표시
- 13. 경고 만들기 R
- 14. tablayout on android
- 15. Android TabLayout 크래킹
- 16. Android TabLayout 튜토리얼의 문제
- 17. TabLayout ViewPager 명확한 부분
- 18. TabLayout 단편에서 오류가 발생했습니다.
- 19. TabLayout 사용자 정의 메뉴
- 20. 다중 조각이있는 Tablayout 탭
- 21. Tablayout 안드로이드 탭 숨기기
- 22. TabLayout 용 ScrollView
- 23. TabLayout onTabSelected가 호출되지 않았습니다.
- 24. 키보드의 Tablayout 문제
- 25. 일부 파편에서 Tablayout 숨기기
- 26. 경고 상자에 허용되는 문자 수 - 자바 스크립트
- 27. 경고 대화 상자에 메시지가 올바르게 표시되지 않습니다.
- 28. 빈 텍스트 상자에 대해 경고 메시지를 표시하려고합니다.
- 29. 서식로드시 경고 상자에 부모 연락처 작업 표시
- 30. Android : 경고 대화 상자에 매개 변수 전달
무엇을 시도 했습니까 ?? –
경고 상자에 여러 탭의 내용을 표시하려고합니다. – user2603471
당신은 그것에 대한 사용자 정의 레이아웃을 만들 수 있으며 AlertDialog에서 팽창. – Piyush