如何获得默认通知背景颜色棒棒堂自定义通知?通知、自定义、如何获得、棒棒

由网友(Misanthrope(厌爱者))分享简介:我有一个问题,我的自定义通知背景棒棒糖的颜色。它是黑色的,它应该是白色的。该文字颜色是确定:I'm having an issue with the color of my custom notification background in Lollipop.It's black where it should...

我有一个问题,我的自定义通知背景棒棒糖的颜色。 它是黑色的,它应该是白色的。 该文字颜色是确定:

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>    
阅读全文

相关推荐

最新文章