安卓 ToolBar 颜色样式设置
设置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 颜色样式设置的更多相关文章
- CSS样式设置语法全解,样式优先级、值和单位、字体、文本、块级元素,行内元素,替换元素、非替换元素、display、float、position、table、li、光标、边距边框、轮廓、颜色背景
全栈工程师开发手册 (作者:栾鹏) 一个demo学会css css选择器全解 css操作语法全解 CSS样式设置语法全解: 样式优先级 1. !important标记的样式 > 内联样式(sty ...
- placeholder的样式设置
在input框中有时想将输入的字和placeholder设为不同的颜色或其它效果,这时就可以用以下代码来对placeholder进行样式设置了. ::-webkit-input-placeholder ...
- Css3:选择器、字体和颜色样式
1.私有前缀及其用法 在CSS3模块标准尚未被W3C批准或者标准所提议的特性尚未被浏览器完全实现时,浏览器厂商会使用所谓的私有前缀来测试“试验性的”CSS特性.看看CSS3中实现圆角的代码: .rou ...
- devexpress表格控件gridcontrol设置隔行变色、焦点行颜色、设置(改变)显示值、固定列不移动(附源码)
介绍一些常用的gridcontrol设置. 1.设置隔行变色.首先设置显示隔行变色,步骤:OptionsView-->EnableAppearanceEvenRow-->true和Opti ...
- 导出Excel之Epplus使用教程2(样式设置)
导出Excel之Epplus使用教程1(基本介绍) 导出Excel之Epplus使用教程2(样式设置) 导出Excel之Epplus使用教程3(图表设置) 导出Excel之Epplus使用教程4(其他 ...
- PowerDesigner的样式设置
原文:PowerDesigner的样式设置 PD提供了强大的配置功能,可以对生成的数据库对象命名.数据模型的展现进行设置.这里首先讲下样式的设置. 颜色和字体设置 1.单独设置某个对象的颜色和字体 1 ...
- 增加字体和颜色样式-------CSS
通过使用CSS,控制文本的字体,风格和颜色 1.基本操作: body{ font-family: Verdana, Geneva, Tahoma, sans-serif } body{ font-si ...
- QListWidget与QTableWidget的使用以及样式设置
QListWidget和QTableWidget的使用和属性,QTableWidget和QListWidget样式表的设置,滚动条的样式设置 一.QListWidget的使用 //一.QListWid ...
- HTML+CSS样式设置——CSS一学就会
HTML+CSS样式设置 CSS:(Cascading Style Sheets)层叠样式设置表. 网页的展示效果跟其排版有非常大的关系.排版则主要依靠CSS来设置.调节. 以下说CSS与HTML的联 ...
随机推荐
- mobile_基础事件
DOM0 级事件模型(模拟器不支持) DOM0 级事件绑定 在 移动端有 300ms 的延迟 ontouchstart 手指按下事件 ontouchmove 手指移动事件 pntouchend 手指离 ...
- Ajax_简介: 异步的 JS 和 XML_原生写 ajax 分析其原理_jquery_ajax_art-template
AJAX Asynchronous JavaScript And XML 通过 AJAX 可以在 浏览器中向 服务器 发送异步请求 一种 使用现有标准的 新方法,而非新语言 XML 可扩展标记语言 ...
- C# 与Sql server 获取数据和执行命令
C#数据库命封装在 System.Data.SqlClient 之中: 从使用的数据库中获取连接串connectionstring:"server=xx.xxx.xx.xx,xxxx: da ...
- [LeetCode] Ambiguous Coordinates 模糊的坐标
We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we re ...
- js高级的2
BOM0级事件元素绑定多个click最后只执行最后一个click. DOM2级事件元素绑定多个click,都要执行 注意当绑定的多个事件名,函数名,事件发生阶段三者完全一样时,才执行最后一个 div. ...
- C++接口与实现的抽象分离
IPerson.h #ifndef I_PERSON_H_ #define I_PERSON_H_ #include <string> #include <ostream> c ...
- css学习_cs3s旋转的图片
1. ,鼠标移开后图片面向屏幕后又自动可见了. 2.css3动画 !!定义好动画后再引用 4.多组动画(百分比) 案例: 案例2----无缝滚动
- nginx的proxy_redirect
proxy_redirect 语法:proxy_redirect [ default|off|redirect replacement ]; 默认:proxy_redirect default; 配置 ...
- django的分页与添加图片
分页: 在主页面的views里写接口 导包: from django.core.paginator import Paginator 接口: id=request.GET.get("page ...
- ide phpStorm管理远程主机