通知栏设置系统字体颜色
来源:互联网 发布:天津青蛙网络 编辑:程序博客网 时间:2024/05/29 04:06
转载自:http://blog.csdn.net/caroline_wendy/article/details/50115525
Android的Rom版本非常多, 通知栏颜色也各有不同, 如HTC是白底, 红米Note是暗色透明, 也有其他黑底, 灰底等. 统一设置相同的字体颜色, 必然会导致颜色冲突. 那么如何设置字体颜色, 可以正常显示呢?
如HTC(5.0)
, 标题和内容的颜色已经和系统完全相同, 字体大小是适配的.
如红米Note
, 标题和内容的颜色统一使用StatusBar字体的颜色.
通知的逻辑
- 1
- 2
- 3
- 1
- 2
- 3
1. 版本5.0以下
通知的背景默认系统背景, 字体颜色@style/TextAppearance.StatusBar.EventContent
.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
TextAppearance.StatusBar.EventContent
, 顾名思义StatusBar的事件内容文本样式. 在系统中, 会默认匹配, 如灰色等.
2. 版本5.0及以上
新建layout-v21
, 表面5.0版本以后使用.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
@android:style/TextAppearance.Material.Notification.Title
通知栏标题.@android:style/TextAppearance.Material.Notification.Line2
通知栏内容.
这样就可以完全匹配系统颜色.
OK, 这个问题已经解决了.
0 0
- 通知栏设置系统字体颜色
- 通知栏设置系统字体颜色
- android设置通知栏颜色
- 设置Android通知栏Notification的字体/图标颜色随背景色变化而变化
- 设置状态通知栏的颜色
- Android 自定义系统通知栏的颜色
- iOS8下,如何将UIButton的字体颜色设置成系统自带的字体颜色?
- 设置字体与颜色
- java设置字体颜色
- putty 设置字体颜色
- printf 设置字体颜色
- 字体颜色设置
- 设置字体和颜色
- html字体颜色设置
- HTML字体颜色设置
- xcode 设置字体颜色
- pickerView设置字体颜色
- anroid设置字体颜色
- 【Ubuntu】搭建环境安装软件前apt-get update失败,怎么办?
- Java笔记
- js中两种解码和编码的小区别 en(de)codeURI和de(en)codeURIComponent
- 01 Matrix
- Java中byte转int
- 通知栏设置系统字体颜色
- MAKE the opencv3.1 and the opencv-contrib at the same time
- 普里姆算法 图论 南阳38题 布线问题
- [Unity优化]UWA性能诊断与优化
- Python调用Matlab引擎
- spacemacs复制minibuffer的内容到buffer里
- CF
- 520. Detect Capital
- JAVAEE-文件下载