我创建了一个自定义布局的AlertDialog,并能正常工作, 但我有我的布局的文本样式的问题。的Android:自定义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使用系统的颜色,所以我警觉需要保持同一色性
但我不希望它是白色的,更清楚,我想其他的对话框相同的颜色。例如,在安卓4.0的对话框是白加黑的文字,我想保持色彩的父类! – Ivan 2013-05-14 18:23:55
那么你可能要考虑的风格和主题:http://developer.android.com/guide/topics/ui/themes.html#PlatformStyles – 2013-05-14 18:28:02