zoukankan      html  css  js  c++  java
  • Android 5.x特性概览二

      上文 ,对Android 5.X特性,主要是Material Design的特性进行了介绍,这篇文章我们来使用Material Design主题。

      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,从而实现不同的颜色风格。效果图如下所示:

  • 相关阅读:
    04 body中的相关标签
    03 我的第一个html页面
    02 标签的分类
    01 前端初识
    10-pymysql的应用
    NOIP2012提高组初赛总结(题目+易错点+解析)
    NOIP2011提高组初赛总结(题目+易错点+解析)
    浅谈哈夫曼编码
    关于P类问题,NP问题,NPC问题的一些粗浅理解
    NOIP2010提高组初赛总结(题目+易错点+解析)
  • 原文地址:https://www.cnblogs.com/manuosex/p/5265732.html
Copyright © 2011-2022 走看看