我在应用程序中有一个AlertDialog。它包含一系列自定义视图,其中包含TextView小部件。在Android 2.x上一切正常。AlertDialog是使用白色列表和黑色文本创建的。但是当我在Android 3.x设备上运行我的应用程序时,所有的TextView都是黑色的,并且列表的背景也是黑色的。所以,在我点击并长按其中一个项目之前,我看不到文字。
这是来自布局文件的TextView定义:
我曾认为在
这是来自布局文件的TextView定义:
<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceSmallInverse" />
我曾认为在
textAppearance
属性中使用textAppearanceSmallInverse
是设置文本参数的正确方式,而且它应该能够在所有设备上正常工作,但似乎我错了。那么,我应该怎么做才能使AlertDialog
在所有平台上正确显示列表项呢?提前感谢您的帮助。