我为 AlertDialog 创建了一个自定义布局,它工作正常,但是我的布局的文本样式有问题。
这是我的 alertDialog 的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/namedialoglable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/profilename" />
<EditText
android:id="@+id/namedialoginput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/namedialoglable"
android:layout_marginTop="24dp"
android:ems="10"
android:selectAllOnFocus="true"
android:text="@string/defaultname" >
<requestFocus />
</EditText>
</RelativeLayout>
问题是默认 AlertDialog 中的文本是白色的,而在我的自定义对话框中是黑色的。我只想使用与其他 AlertDialog 相同的颜色。
怎么做?
编辑 要更清楚:我想保持父文本颜色,而不是强制我的自定义对话框颜色为白色。我认为 AlertDialog 使用系统颜色,所以我的警报需要保持相同的颜色