Android编程权威指南(第2版)—第20章挑战练习

来源:互联网 发布:柘城淘宝运营招聘 编辑:程序博客网 时间:2024/06/05 18:16

20.9 挑战练习:创建多版本主题

用的模拟器版本是Lollipop

(1)创建values-v21文件夹


(2)创建目录下的styles.xml文件

<?xml version="1.0" encoding="utf-8"?><resources>    <style name="BeatBoxButton1" parent="android:style/Widget.Holo.Button">        <item name="android:background">@color/dark_blue</item>    </style>    <style name="BeatBoxButton" parent="android:style/Widget.Material.Button">        <item name="android:background">@color/soothing_blue</item>    </style></resources>

(3)查看效果


按钮颜色湖蓝色(soothing blue),说明用到的是values-v21/styles.xml下的"BeatBoxButton"样式



阅读全文
0 0
原创粉丝点击