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">



  • 相关阅读:
    【刷题】洛谷 P4319 变化的道路
    【刷题】BZOJ 4573 [Zjoi2016]大森林
    CSS3_天猫商品墙
    CSS3_3D 变换
    CSS3_扇形导航_transitionend 事件
    CSS3_过渡_2D 变换_瓶体旋转_动态时钟
    CSS3_多列布局
    CSS3_线性渐变_径向渐变----背景
    CSS3_盒子背景
    CSS3_盒阴影_倒影_盒子大小可调
  • 原文地址:https://www.cnblogs.com/qianyukun/p/5340481.html
Copyright © 2011-2022 走看看