목록이 표시 될 때 메시지 및 제목을 표시하려면 사용자 정의 제목보기를 작성해야했습니다. 대화 상자의 내용 영역에 목록이 표시되기 때문입니다. 따라서 대화 상자에는 메시지와 목록을 모두 표시 할 수 없습니다. AlertDialogs의 제목 텍스트를 사용자 정의하기 위해 기본 제목 텍스트보기 스타일 사용
내 사용자 지정보기
가있는 LinearLayout입니다 :<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="24dp"
android:paddingBottom="20dp"
style="@style/Base.Theme.AppCompat.Dialog.Alert"
>
<TextView
android:id="@+id/alert_dialog_custom_title_textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:textSize="20sp"
android:textStyle="bold"
/>
<TextView
android:id="@+id/alert_dialog_custom_message_textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"/>
</LinearLayout>
주어진 정보에 따라 주어진,이 모양이 다르다 디폴트의 값
내 질문 :
-
나는 기본 하나에 같은 스타일이있는 텍스트 뷰를 만들 수있는 방법
- ?
아마 내 텍스트 뷰
편집에 스타일을 설정하는 등의 방법이있다 : 난 그냥 기본에 AlertDialog와 같은 자사의 시각 성을 만드는 스타일 속성을 설정할.
내 텍스트 뷰는 다음과 같이 이미 :
이<TextView
android:id="@+id/alert_dialog_custom_title_textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="messsage"
style="?android:attr/titleTextStyle"
/>
android는 텍스트의 크기를 제공하므로이를 사용할 수 있습니다. –