Material Design控制项目全局样式(二)
来源:互联网 发布:京东万象数据 编辑:程序博客网 时间:2024/06/09 19:23
为什么要用appcompat项目,因为里面是谷歌精心准备的---解决android碎片化开发蛋疼的问题,让我们app编译出来在各种高低版本之间、不同的厂商生产的ROM之间显示出来的效果UI控件等有一较一致的体验。
使用步骤:
1.引入appcompat-v7项目(包括了android-support-v7-appcompat.jar和资源文件,前一篇已经讲过)
2.写自己的全局样式:
<!--Base application theme, dependent on API level. This theme is replacedby AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --> </style> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:textColor">@color/mytextcolor</item> <item name="colorPrimary">@color/colorPrimary_pink</item> <item name="colorPrimaryDark">@color/colorPrimary_pinkDark</item> <item name="android:windowBackground">@color/background</item> <item name="colorAccent">@color/accent_material_dark</item> <!-- 设置虚拟导航栏背景颜色 --> <item name="android:navigationBarColor">@color/colorPrimary_pink</item> </style>colorPrimary:主色,
colorPrimaryDark:主色--深色,一般可以用于状态栏颜色、底部导航栏
colorAccent:(代表各个控件的基调颜色--CheckBox、RadioButton、ProgressBar等等)
"android:textColor":当前所有的文本颜色
有人可能不理解,一幅图解决问题
0 0
- Material Design控制项目全局样式(二)
- Material Design 系列 控制项目全局样式
- MaterialDesign控制项目全局样式
- Material Design(二)
- Material Design中文版(二)
- Material Design之主题样式
- Android:Material Design(二) Material主题
- material design(二) MaterialEditText
- Material Design动画(二)
- Material Design入门(二)
- Material Design学习(二)
- Material Design控件使用(二)
- Material Design 学习(二)
- Days40 Material Design(二)
- Material Design控件使用(二)
- Material Design控件使用(二)
- Material Design动画(二)
- Material Design控件使用(二)
- 统计车牌识别里面各个lable 的数量
- oracle的一些sql查询例子,(子查询、分组查询、求和、求平均数等等)都囊括到了。(2)
- C语言联合体(union)的使用方法及其本质-union
- 关于表单用js如何实现占位符placeholder的效果
- Android手机使用Fiddler方法介绍(原)
- Material Design控制项目全局样式(二)
- js手机横竖屏判断
- 三目运算符
- Android json与双向list相互解析
- Android:EditText输入中英文查找用户列表
- Linux基础概念
- php <?= //show code ?> 作用
- Spring @Transactional
- 模拟手机虚拟数字键盘