设置Toolbar弹出菜单的字体颜色和背景颜色,包括三个点菜单颜色和返回图标的颜色。

布局文件xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"> <android.support.v7.widget.Toolbar
android:id="@+id/titleBar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
style="@style/ToolbarStyle"/> <LinearLayout
android:id="@+id/group"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" />
</LinearLayout>

样式代码文件xml

 <!--溢出菜单样式 -->
<style name="AppTheme.PopupOverlay">
<item name="overlapAnchor">false</item>
<item name="android:dropDownWidth">wrap_content</item>
<item name="android:colorBackground">@color/colorPrimary</item>
<item name="android:textColor">@color/textColorPrimary</item>
</style> <style name="ToolbarStyle" parent="Theme.AppCompat.Light.NoActionBar">
<item name="popupTheme">@style/AppTheme.PopupOverlay</item>
<item name="theme">@style/ToolbarTheme</item>
</style> <!--设置按钮颜色-->
<style name="ToolbarTheme">
<!-- Used to tint the back arrow, menu and spinner arrow -->
<item name="colorControlNormal">@color/textColorPrimary</item>
</style>

颜色属性

    <color name="colorPrimary">#3F51B5</color>
<color name="textColorPrimary">#e6e6e6</color>

安卓 ToolBar 颜色样式设置的更多相关文章

  1. CSS样式设置语法全解,样式优先级、值和单位、字体、文本、块级元素,行内元素,替换元素、非替换元素、display、float、position、table、li、光标、边距边框、轮廓、颜色背景

    全栈工程师开发手册 (作者:栾鹏) 一个demo学会css css选择器全解 css操作语法全解 CSS样式设置语法全解: 样式优先级 1. !important标记的样式 > 内联样式(sty ...

  2. placeholder的样式设置

    在input框中有时想将输入的字和placeholder设为不同的颜色或其它效果,这时就可以用以下代码来对placeholder进行样式设置了. ::-webkit-input-placeholder ...

  3. Css3:选择器、字体和颜色样式

    1.私有前缀及其用法 在CSS3模块标准尚未被W3C批准或者标准所提议的特性尚未被浏览器完全实现时,浏览器厂商会使用所谓的私有前缀来测试“试验性的”CSS特性.看看CSS3中实现圆角的代码: .rou ...

  4. devexpress表格控件gridcontrol设置隔行变色、焦点行颜色、设置(改变)显示值、固定列不移动(附源码)

    介绍一些常用的gridcontrol设置. 1.设置隔行变色.首先设置显示隔行变色,步骤:OptionsView-->EnableAppearanceEvenRow-->true和Opti ...

  5. 导出Excel之Epplus使用教程2(样式设置)

    导出Excel之Epplus使用教程1(基本介绍) 导出Excel之Epplus使用教程2(样式设置) 导出Excel之Epplus使用教程3(图表设置) 导出Excel之Epplus使用教程4(其他 ...

  6. PowerDesigner的样式设置

    原文:PowerDesigner的样式设置 PD提供了强大的配置功能,可以对生成的数据库对象命名.数据模型的展现进行设置.这里首先讲下样式的设置. 颜色和字体设置 1.单独设置某个对象的颜色和字体 1 ...

  7. 增加字体和颜色样式-------CSS

    通过使用CSS,控制文本的字体,风格和颜色 1.基本操作: body{ font-family: Verdana, Geneva, Tahoma, sans-serif } body{ font-si ...

  8. QListWidget与QTableWidget的使用以及样式设置

    QListWidget和QTableWidget的使用和属性,QTableWidget和QListWidget样式表的设置,滚动条的样式设置 一.QListWidget的使用 //一.QListWid ...

  9. HTML+CSS样式设置——CSS一学就会

    HTML+CSS样式设置 CSS:(Cascading Style Sheets)层叠样式设置表. 网页的展示效果跟其排版有非常大的关系.排版则主要依靠CSS来设置.调节. 以下说CSS与HTML的联 ...

随机推荐

  1. requirejs的使用和快速理解

    样例来自https://www.jianshu.com/p/b8a6824c8e07 requirejs有以下功能 声明不同js文件之间的依赖 可以按需.并行.延时载入js库 可以让我们的代码以模块化 ...

  2. [LeetCode] Valid Tic-Tac-Toe State 验证井字棋状态

    A Tic-Tac-Toe board is given as a string array board. Return True if and only if it is possible to r ...

  3. [LeetCode] Serialize and Deserialize N-ary Tree N叉搜索树的序列化和去序列化

    Serialization is the process of converting a data structure or object into a sequence of bits so tha ...

  4. xampp+discuz 安装踩坑后总结

    之前安装xampp先是出现mysql无法启动,接着安装discuz到最后一部时出现乱码,以及报错(0).后来卸载了xampp,重新安装xampp和discuz后就可以了,应该是版本太高的问题, xam ...

  5. 软件分享--EditPlus

    有些人分享的报毒,不好用,所以在这分享个好用的.百度网盘地址: 链接: https://pan.baidu.com/s/15s7I6p0K_36KPtzRDbHfrw 密码:kl5w

  6. 20175303 2018-2019-2 《Java程序设计》第7周学习总结

    20175303 2018-2019-2 <Java程序设计>第7周学习总结 教材学习内容总结 1.String类: Java专门提供了用来处理字符序列的String类 构造String对 ...

  7. 【大数据和云计算技术社区】分库分表技术演进&最佳实践笔记

    1.需求背景 移动互联网时代,海量的用户每天产生海量的数量,这些海量数据远不是一张表能Hold住的.比如 用户表:支付宝8亿,微信10亿.CITIC对公140万,对私8700万. 订单表:美团每天几千 ...

  8. linux基础命令--rmdir 删除空目录

    描述 rmdir命令用于删除空目录. 语法 rmdir [OPTION]... DIRECTORY... 选项列表 选项(常用的已加粗) 说明 --ignore-fail-on-non-empty 忽 ...

  9. centos 7 防火墙操作

    1.查看防火墙状态 firewall-cmd --state 2.开启防火墙 systemctl start firewalld.service 3.关闭防火墙 systemctl stop fire ...

  10. 使用STS创建springboot项目pom.xml文件报错org.apache.maven.archiver.MavenArchiver.getManifest

    首先我的STS版本时:3.7.3 解决办法:->help->Install New Software -> add->location ->输入: http://repo ...