zoukankan      html  css  js  c++  java
  • ToolBar Style

    • colorPrimaryDark

      • 状态栏背景色。

      • 在 style 的属性中设置。

    • textColorPrimary

      • App bar 上的标题与更多菜单中的文字颜色。

      • 在 style 的属性中设置。

    • App bar 的背景色

      • Actionbar 的背景色设定在 style 中的 colorPrimary。

      • Toolbar 的背景色在layout文件中设置background属性。

    • colorAccent

      • 各控制元件(如:check box、switch 或是 radoi) 被勾选 (checked) 或是选定 (selected) 的颜色。

      • 在 style 的属性中设置。

    • colorControlNormal

      • 各控制元件的预设颜色。

      • 在 style 的属性中设置

    • windowBackground

      • App 的背景色。

      • 在 style 的属性中设置

    • navigationBarColor

      • 导航栏的背景色,但只能用在 API Level 21 (Android 5) 以上的版本

      • 在 style 的属性中设置

    更改颜色需要注意 :

    1.setSupportActionBar(toolbar);

    更改menu的文字颜色、背景颜色、弹出颜色注意:

    2.app:popupTheme="@style/ToolbarPopupTheme"

    <style name="ToolbarPopupTheme" parent="@style/ThemeOverlay.AppCompat">
    <item name="android:colorBackground">@color/colorPrimary</item>
    </style>

    <style name="AppTheme" parent="AppTheme.Base"/>
    <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="windowNoTitle">true</item>
    <!-- toolbar标题文字颜色 -->
    <item name="android:textColorPrimary">@android:color/white</item>
    <item name="alertDialogTheme">@style/AlertDialogCustom</item>
    <!-- <item name="toolbarStyle">@style/Widget.Toolbar</item> -->
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorControlNormal">@android:color/white</item>
    </style>



    <application
    android:name=".WifixApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:theme="@style/AppTheme">



  • 相关阅读:
    IOS照相
    起学习iOS开发专用词汇
    django[post与get测试]
    起名字好难啊!(初识Django)
    MTV模型
    Django安装以及介绍
    数据库操作
    数据库其它操作
    数据库经典习题,
    数据库基本操作
  • 原文地址:https://www.cnblogs.com/qianyukun/p/5340481.html
Copyright © 2011-2022 走看看