更改ToolBar的样式(侧边栏联动箭头颜色,字体大小和颜色)
2016-12-17 15:44
507 查看
更改ToolBar的样式(侧边栏联动箭头颜色,字体大小和颜色)
布局文件(也要引用)
<!--小汉堡颜色为白色--> <style name="DrawerArrowStyle" parent="@style/Widget.AppCompat.DrawerArrowToggle"> <item name="spinBars">true</item> <item name="color">@android:color/white</item> </style> <!-- ToolBar菜单样式 --> <style name="ToolbarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar"> <item name="actionMenuTextColor">@color/white</item> <!-- menu中字体颜色--> <item name="android:textSize">18sp</item> <!-- 字体大小--> <item name="android:textColor">@color/white</item> <item name="android:color">@color/white</item> </style> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <item name="drawerArrowStyle">@style/DrawerArrowStyle</item> <!--小汉堡颜色--> <item name="toolbarStyle">@style/ToolbarTheme</item> <!-- All customizations that are NOT specific to a particular API-level can go here. --> </style>
布局文件(也要引用)
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_home" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" app:theme="@style/ToolbarTheme" android:layout_height="wrap_content" android:background="@color/actionbar_background" android:minHeight="?attr/actionBarSize" /> <include layout="@layout/drawerlayout"></include> </LinearLayout>
相关文章推荐
- xamarin.from ToolbarItem 字体大小和颜色更改
- Python笔记——PyCharm V2017 1.5 更改背景颜色、菜单栏字体和大小、代码部分字体大小
- CSDN-markdown 文字样式设置(字体, 大小, 颜色, 高亮底色)
- android 更改TextView部分字体颜色、大小、背景
- 更改UILabel的字体样式及某段文字中的颜色
- android 设置Spinner文字标题颜色 字体大小样式
- devexpress实现单元格根据条件显示不同的样式(颜色、字体、对齐方式,大小等)
- devexpress实现单元格根据条件显示不同的样式(颜色、字体、对齐方式,大小等)
- android:更改PagerTabStrip背景颜色,标题字体样式、颜色和图标,以及指示条的颜色
- Visual Studio 更改字体大小显示行号和更改主题(背景)颜色
- eclipse更改字体大小、更改背景颜色、SVN插件错误
- 更改PDF文本框中字体、大小、颜色…
- android 更改TextView中任意位置字体大小和颜色的方法
- android 设置Spinner文字标题颜色 字体大小样式
- 安卓利用按钮Button更改的字体大小、字体颜色、背景颜色代码
- 同一个TextView如何显示不同颜色的文字、字体大小、字体样式
- Flex学习总结:Flex更改Alert提示框的字体大小和样式等
- VC2010 C++如何更改代码的字体大小和颜色
- MFC 更改界面IDC_STATIC颜色和字体以及大小【二】
- 修改系统action bar字体大小、粗细、颜色等样式的方法