如何指定android通知以便文本在所有设备上可见? 某些设备在通知区域中具有黑色背景,如果文本为黑色,则不可见。 而其他设备在通知区域中有白色背景。如何设置android通知以便文本在所有设备上可见
谢谢。
如何指定android通知以便文本在所有设备上可见? 某些设备在通知区域中具有黑色背景,如果文本为黑色,则不可见。 而其他设备在通知区域中有白色背景。如何设置android通知以便文本在所有设备上可见
谢谢。
您应该使用设置的背景创建自己的视图,并使用该视图显示文本。 :)
查看documentation得到一些示例代码。
您可以访问系统颜色属性并在布局中使用它。 例如使用
android:textColor="?android:textColorPrimary"
到一个TextView的文本颜色设置为当前主题的主要文本颜色。还有很多其他的属性,请看Referencing Style Attributes和attributes list。
使用
android:textColor="?android:textColorPrimary"
和/或
android:textColor="?android:textColorSecondary"
结合
android:background="?android:colorBackground"
这是指在当前样式原生属性,让您的通知将永远是清晰可辨。
[自定义通知布局和文本颜色]的可能重复(http://stackoverflow.com/questions/4867338/custom-notification-layouts-and-text-colors) – eldarerathis