不同系统的通知背景色不同,使用自定义通知使用透明背景色,字体颜色跟随系统的Notification中文字的样式。
在res的values目录下定义styles.xml文件如下:

<?xml version="1.0" encoding="utf-8"?><resources>    <style        name="NotificationInfo"        parent="android:TextAppearance.StatusBar.EventContent" />    <style        name="NotificationTitle"        parent="android:TextAppearance.StatusBar.EventContent.Title" />resources>

在res的values-v21目录下定义styles.xml文件如下:

<?xml version="1.0" encoding="utf-8"?><resources>    <style        name="NotificationInfo"        parent="android:TextAppearance.Material.Notification.Info" />    <style        name="NotificationTitle"        parent="android:TextAppearance.Material.Notification.Title" />resources>

自定义通知布局文件调用:

"wrap_content"    android:layout_height="wrap_content"    android:text="@string/notification_title"    style="@style/NotificationTitle" />"@+id/content_tv"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:text="@string/toast_ble_disconnected_1"    style="@style/NotificationInfo" />

更多相关文章

  1. 系统定义弹窗以及自定义弹窗
  2. Android之CheckBox(多选按钮)
  3. Mac OS 上配置Android(安卓)studio的真机调试环境
  4. Android(安卓)Fragment学习笔记(一)
  5. Android(安卓)boot.img 结构
  6. 解决Android(安卓)studio 2.3升级到Android(安卓)studio 3.0 后a
  7. Android(安卓)Studio添加so文件并打包到APK的lib文件夹中
  8. 将tensorflow训练好的模型移植到Android(安卓)(MNIST手写数字识
  9. 创建android phonegap项目

随机推荐

  1. jQuery.zTree 点击节点展开折叠子节点
  2. jquery 生成table表格 部分代码
  3. 如何部署Bower安装的软件包?
  4. 用WordPress决定jQuery的版本?
  5. jQuery无法从localhost检索数据
  6. 如何使用jquery ajax获取api数据?
  7. 用jquery 绑定一个按钮click事件后,第一次
  8. Jquery中的队列函数quene()、dequene()、
  9. JQUERY中做表单验证,谁有带时间的日期选择
  10. 请问jquery如何选择tr下的n个tr?