Android 5.x特性概览二
2016-03-11 15:52
423 查看
上文 ,对Android 5.X特性,主要是Material Design的特性进行了介绍,这篇文章我们来使用Material Design主题。
Material Design 现在有三种默认的主题可以设置,相应源代码如下所示:
效果图如下所示:
在Android5.x中引入了colour Palette的概念,Color Palette 让app的开发者自己设定系统区域颜色,从而使整个app的颜色与系统区域的颜色来保持相互的统一。
譬如,使用上述xml代码,用户就能够自定义自己的 Style 来创建自己的Palette,从而实现不同的颜色风格。效果图如下所示:
Material Design 现在有三种默认的主题可以设置,相应源代码如下所示:
@android:style/Theme.Material (dark version) @android:style/Theme.Material.Light (light version) @android:style/Theme.Material.Light.DarkActionBar
效果图如下所示:
在Android5.x中引入了colour Palette的概念,Color Palette 让app的开发者自己设定系统区域颜色,从而使整个app的颜色与系统区域的颜色来保持相互的统一。
<style name="AppBaseTheme" parent="android:Theme.Material"> <!-- 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:colorPrimary">#bebebe</item> <item name="android:colorPrimaryDark">#FF5AEBFF</item> <!-- theme UI controls like checkboxes and text fields --> <item name="android:navigationBarColor">#FFFF4130</item> </style>
譬如,使用上述xml代码,用户就能够自定义自己的 Style 来创建自己的Palette,从而实现不同的颜色风格。效果图如下所示:
相关文章推荐
- 咱们来看看谷歌Design包里的SnackBar
- android中PhoneWindow、DecorView
- android定时回到主页面
- Android中top命令字段含义
- Android下拉刷新上拉加载控件(适用于所有View)
- Android APK反编译就这么简单 详解(附图)
- 二维码下载,区分是 ios 和 android
- Android Studio系列教程四--Gradle基础
- Android Quantity Strings 的 getQuantityString方法取值问题
- 使用SwipeBackLayout过程中设置windowIsTranslucent遇到滑动显示手机桌面问题
- 将Eclipse代码导入到AndroidStudio的两种方式
- 解决 android studio .9图报错
- Android横竖屏切换总结
- 判断Android程序是否在后台中运行
- Android 动画播放时退出或隐藏界面时报错
- Android InputStream转Bitmap
- [Android]AndFix使用说明
- Android Volley 基本用法及解析
- Android WebView与JavaScript交互(一)
- Android WebView+JSON+JavaScript