android toolbar效果4
两个标题的,右边一个按钮
activity_main.xml:
<android.support.v7.widget.Toolbar
style="style/toolbarStyle"
android:id="@+id/my_toolbar"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="微信(32)"
android:layout_gravity="left"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:textSize="18sp"
android:id="@+id/toolbar_title2" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="事业部讨论群"
android:layout_gravity="center"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:id="@+id/toolbar_title" /> <ImageView
android:id="@+id/bluetoothState"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/fm_detailitem_walk"
android:contentDescription="content_description_bluetooth_status"
android:padding="8dp"
android:layout_marginRight="10dp"
android:layout_gravity="right"/>
</android.support.v7.widget.Toolbar>
styles.xml
<resources> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="toolbarStyle">@style/Widget.AppCompat.Toolbar</item>
</style> </resources>
android toolbar效果4的更多相关文章
- android toolbar效果3
Title居中,只有一个右边按钮 activity_main.xml: <?xml version="1.0" encoding="utf-8"?> ...
- android toolbar效果2
只有一个按钮的情况 <resources> <string name="app_name">照片</string></resources& ...
- android toolbar效果
layout下的layout_main.xml: <?xml version="1.0" encoding="utf-8"?> <Relati ...
- [置顶]
xamarin android toolbar(踩坑完全入门详解)
网上关于toolbar的教程有很多,很多新手,在使用toolbar的时候踩坑实在太多了,不好好总结一下,实在浪费.如果你想学习toolbar,你肯定会去去搜索androd toolbar,既然你能看到 ...
- Android Toolbar中的title居中问题
版权声明:本文为xing_star原创文章,转载请注明出处! 本文同步自http://javaexception.com/archives/167 Android Toolbar中的title居中问题 ...
- Android动画效果之自定义ViewGroup添加布局动画
前言: 前面几篇文章介绍了补间动画.逐帧动画.属性动画,大部分都是针对View来实现的动画,那么该如何为了一个ViewGroup添加动画呢?今天结合自定义ViewGroup来学习一下布局动画.本文将通 ...
- Android动画效果之Property Animation进阶(属性动画)
前言: 前面初步认识了Android的Property Animation(属性动画)Android动画效果之初识Property Animation(属性动画)(三),并且利用属性动画简单了补间动画 ...
- Android动画效果之初识Property Animation(属性动画)
前言: 前面两篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画).Frame Animation(逐帧动画)Andr ...
- Android动画效果之Frame Animation(逐帧动画)
前言: 上一篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画),今天来总结下Android的另外一种动画Frame ...
随机推荐
- [SCOI2007]排列
看了看数据范围...我艹...爆搜可过? 等等,冷静,让我看一眼题解...我艹...真可过... emm...再冷静分析...emm...还是写状压吧... 这题主要的思路就是 f[i][j] 表示 ...
- L332 NBA: Dwyane Wade and Dirk Nowitzki Say Emotional Goodbyes
Two games in the NBA ended amid emotional scenes on Tuesday as legends at separate teams marked thei ...
- Python基础03_pycharm
pycharm的安装还是很简单的,一路next. 看起来Jet Brains 家的产品长相都差不多啊. 主要是create new project时,路径和解释器的选择,我电脑上有2.7和3.6 所以 ...
- JavaScript 简单的实现 sleep功能 .
function start(){ // console.log("Request handle 'start' was called."); function sleep(mil ...
- Centos6.5修改镜像为国内的阿里云源
第一步:备份你的原镜像文件,以免出错后可以恢复. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back ...
- .net平台常用组建
常用的一些开源组件整理: 导出Excel报表的插件:NOPI.dll(基于微软OpenXml实现)开源的作业调度和自动任务框架:Quartz.NET用于大数据搜索引擎的全文检索框架:Lucene.ne ...
- linux基础命令一
linux基础命令一 1.date命令 date命令介绍:显示或者设置系统日期 date命令的语法: 显示日期:date [options...] [+FORMAT] FORMAT:为显示日期的格 ...
- spring mvc 为什么这么多xml
spring web mvc 处理流程 Architecture web.xml (webapp必要配置) 作用:spring web mvc 使用dispatcherServlet 分发reques ...
- Java BigInterger类
BigInteger概述 可以让超过Integer范围内的数据进行运算 构造方法 public BigInteger(String val) 成员方法 public BigInteger add(Bi ...
- session token两种登陆方式
Session 和 Token 其实Session和Token总体上还是很相似的,但是也有以下区别: 1. 过期时间:Session的过期时间存在cookie的Max-age字段,Token的过期时间 ...