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



  • 相关阅读:
    Kubernetes CNI 发展趋势- iptables_ipvs_bpf_ovs
    《设计模式:可复用面向对象软件的基础》之单例模式
    《设计模式:可复用面向对象软件的基础》之策略模式
    Rancher On K3s 高可用架构部署
    学习计算机的体会与认识
    结对编程1-模块化
    个人作业——APP案例分析
    四则运算——二叉树
    IDEA使用Visual Studio的快捷键配置
    【Java学习笔记】写第一个HelloWorld程序,命令行程序
  • 原文地址:https://www.cnblogs.com/qianyukun/p/5340481.html
Copyright © 2011-2022 走看看