如何获得默认通知背景颜色棒棒堂自定义通知? [英] How to get the default notification background color for custom notification in Lollipop?
本文介绍了如何获得默认通知背景颜色棒棒堂自定义通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个问题,我的自定义通知背景棒棒糖的颜色。 它是黑色的,它应该是白色的。 该文字颜色是确定:
I'm having an issue with the color of my custom notification background in Lollipop. It's black where it should be white. The textColor is OK:
我用
<resources>
<style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" />
<style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title" />
</resources>
不知道如何使用设备默认主题颜色自定义通知?
Any idea how to use the device default theme color for custom notification ?
推荐答案
您的应用程序的targetSdkVersion必须是21
由于艾哈迈德的的answere,价值观-21文件夹中添加另一个样式文件。
Your app's targetSdkVersion must be 21.
As Ahmed's answere, add another styles file in values-21 folder.
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="NotificationText" parent="android:TextAppearance.Material.Notification" />
<style name="NotificationTitle" parent="android:TextAppearance.Material.Notification.Title" />
<style name="NotificationTime" parent="android:TextAppearance.Material.Notification.Time" />
</resources>
这篇关于如何获得默认通知背景颜色棒棒堂自定义通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文