MaterialDesign系列文章(二)Theme主题设置

不怕跌倒,所以飞翔

这是我写的第一篇关于MaterialDesign的文章,希望自己能坚持下来,完成整个系列!!!什么事情都在于坚持...

Theme 主题设置

  • @android:style/Theme.Material
  • @android:style/Theme.Material.Light
  • @android:style/Theme.Material.Light.DarkActionBar

我们可以在values-21中的styles.xml文件中继承这个主题,然后定制一些属性

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

        <!--添加的一些属性-->
        <item name="textColorPrimary">@android:color/white</item><!--标题栏文字颜色-->
        <item name="windowNoTitle">true</item><!--去掉标题栏-->
        <item name="windowActionBar">false</item><!--不显示Actionbar-->
    </style>

但是为了兼容低版本我们要想一些办法才可以的,主要是在4.4及以前的版本要使用** <item name="android:windowNoTitle">true</item>**来去掉标题栏


这一系列文章的地址,希望对大家有帮助

项目地址

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容