2

How can I specify android Notification so that the text is visible on all devices? Some devices has black background in the notification area, and if the text is black, it is not visible. And other devices has white background in the notification area.

Thank you.

4

3 回答 3

1

您可以访问系统颜色属性并在布局中使用它。使用例如

android:textColor="?android:textColorPrimary"

将 TextView 的文本颜色设置为当前主题的主要文本颜色。还有很多其他属性,请查看引用样式属性属性列表

于 2011-11-08T20:15:06.057 回答
0

You should create your own view with a set background, and display your text using that. :)

Check out the documentation to get some sample code.

于 2011-11-08T20:07:50.320 回答
0

利用

android:textColor="?android:textColorPrimary"

和/或

android:textColor="?android:textColorSecondary"

结合

android:background="?android:colorBackground"

这指的是当前样式中的原生属性,因此您的通知将始终清晰易读。

于 2017-03-08T13:58:55.343 回答