两个标题的,右边一个按钮

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的更多相关文章

  1. android toolbar效果3

    Title居中,只有一个右边按钮 activity_main.xml: <?xml version="1.0" encoding="utf-8"?> ...

  2. android toolbar效果2

    只有一个按钮的情况 <resources> <string name="app_name">照片</string></resources& ...

  3. android toolbar效果

    layout下的layout_main.xml: <?xml version="1.0" encoding="utf-8"?> <Relati ...

  4. [置顶] xamarin android toolbar(踩坑完全入门详解)

    网上关于toolbar的教程有很多,很多新手,在使用toolbar的时候踩坑实在太多了,不好好总结一下,实在浪费.如果你想学习toolbar,你肯定会去去搜索androd toolbar,既然你能看到 ...

  5. Android Toolbar中的title居中问题

    版权声明:本文为xing_star原创文章,转载请注明出处! 本文同步自http://javaexception.com/archives/167 Android Toolbar中的title居中问题 ...

  6. Android动画效果之自定义ViewGroup添加布局动画

    前言: 前面几篇文章介绍了补间动画.逐帧动画.属性动画,大部分都是针对View来实现的动画,那么该如何为了一个ViewGroup添加动画呢?今天结合自定义ViewGroup来学习一下布局动画.本文将通 ...

  7. Android动画效果之Property Animation进阶(属性动画)

    前言: 前面初步认识了Android的Property Animation(属性动画)Android动画效果之初识Property Animation(属性动画)(三),并且利用属性动画简单了补间动画 ...

  8. Android动画效果之初识Property Animation(属性动画)

    前言: 前面两篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画).Frame Animation(逐帧动画)Andr ...

  9. Android动画效果之Frame Animation(逐帧动画)

    前言: 上一篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画),今天来总结下Android的另外一种动画Frame ...

随机推荐

  1. [SCOI2005]繁忙的都市

    emm...就是个最小生成树板子...我还能说啥... 为啥我早出生个十多年.../(ㄒoㄒ)/~~ 五六年也好啊.../(ㄒoㄒ)/~~ 呆码: #include<iostream> # ...

  2. python接口自动化测试(一)-request模块

    urllib.request模块是python3针对处理url的. 1. 首先导入: from urllib import request 2. 构造url,构造url的headers信息和传参[re ...

  3. 入门项目 A5-1 interface-bank 第三方接口1

    from db import db_handler # 提现接口 def withdraw_interface(name, money): # 定义提现接口,传入name与money参数 user_d ...

  4. 【oracle入门】数据模型

    数据模式也是一这种模型,它是数据库中用于提供信息表示的操作手段的形式架构,是数据库中用来对现实世界惊喜抽象的工具.数据模型按不同的应用层次分为3种类型,分别为概念数据模型.逻辑数据模型.物理数据模型. ...

  5. 如何理解Minkowski不等式

    [转载请注明出处]http://www.cnblogs.com/mashiqi 2017/02/16 Minkowski不等式: 设$f$是$\mathbb{R}^n \times \mathbb{R ...

  6. 1.golang的环境搭建及入门

    安装包下载 下载链接:https://dl.google.com/go/go1.12.3.windows-amd64.msi 环境搭建 安装完成之后,找一个来存放go语言文件的文件夹,我这里选的是G: ...

  7. BAT批处理文件,脚本时间值%time:~0,2%%time:~3,2%%time:~6,2%的用法。

    最近公司的项目,需要部署一个oracle定时备份脚本,删除掉特定时间前的备份文件.BAT批处理文件结合windows系统(任务计划程序) 正常情况下我们的任务计划会有反馈数值,通过它可以判断这个任务计 ...

  8. paramiko模块(01-04节)、SSH

    1.  SSH(安全外壳协议) SSH 为 Secure Shell 的缩写,由 IETF 的网络小组(Network Working Group)所制定:SSH 为建立在应用层基础上的安全协议.SS ...

  9. cordova打开文件系统插件的使用: cordova-plugin-file-opener2

    1. 添加插件:cordova plugin add cordova-plugin-file-opener2 2. 调用方法: var target="/sdcard/Download/io ...

  10. PythonStudy——第一阶段性测试

    1.Python解释器,在2.x和3.x上分别采用的是什么默认编码8 2.定义字符串变量时,单引号,双引号,三引号什么区别? 3.编程语言可以分为哪三类,特点都是什么 4.定义一个变量有三个特性, 5 ...