简体   繁体   中英

android notification background color is not white on lollipop

As we known that Android lollipop force set the notification background color to white, so we can set the style of TextView according to different sdk version by putting style.xml in folder values-v21.

So here comes my question, on some third party ROMs, for example, the EMUI developed by Huawei tech co., the background of notification is not white(nearly black), by setting style to

android:TextAppearance.Material.Notification.Title

the color of the text is almost black, as a result, we cannot see the text clearly. I had been searching the internet for almost two days but find nothing helps.

I am trying to get the color of the notification background and set the text color dynamically, but I don't know how to accomplish this.

Need your help, thanks a lot.

好的,所以我只使用官方API来设置通知信息,该信息将填充默认的通知布局( status_bar_latest_event_content.xml ),而不是我的自定义布局。rom更改了status_bar_latest_event_content.xml的默认背景和文本颜色它不会(或无法)更改自定义布局。

mBuilder.setLargeIcon(combineBitmap).setContentText(notifyString).setSubText("fff");

remove the android:targetSdkVersion="21" from manifest.xml. it will work! and from this there is no prob at all in your apk it just a trick i apply this and i found colorful icon in notification and all features will remain same which u earlier use

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM