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

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. 文本分类TextCNN

    参考来源:https://blog.csdn.net/u012762419/article/details/79561441 TextCNN结构 TextCNN的结构比较简单,输入数据首先通过一个em ...

  2. 最短路,floyd算法,图的最短路径

    题目描述: 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt.但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线 ...

  3. lvs三种模式的优缺点对比

    电面只回答上来少部分,所以......恶补.总结

  4. 剑指Offer 48. 不用加减乘除做加法 (其他)

    题目描述 写一个函数,求两个整数之和,要求在函数体内不得使用+.-.*./四则运算符号. 题目地址 https://www.nowcoder.com/practice/59ac416b4b944300 ...

  5. ecmall 后台添加新菜单

    所谓的开发新菜单,其实是和开发模块相对比的,之前说的开发模块,是在应对较大的,或者较为复杂,又相对独立于其他功能的项目需求. 而开发菜单,就是简单的在后台增加一个一级菜单以及其子菜单,或者直接在现有的 ...

  6. java.lang.ClassNotFoundException:oracle.jdbc.OracleDriver

    在使用JDBC时经常碰到java.lang.ClassNotFoundException:oracle.jdbc.OracleDriver问题 这是jvm找不到驱动类文件,可能是以下原因: 没有导入驱 ...

  7. lombok安装

    今天学习spring boot 时候发现的lombok挺好用的,我这个使用的是spring boot 管理的版本,如果其他的可能需要你们自己去添加版本了,开发工具使用的是idea. maven: &l ...

  8. 【坑】https证书链不完整的坑

    支付宝支付回调https失败,微信分享https连接在微信里打开空白,而chrome等浏览器访问正常. 是的,以上问题我作为半个运维在项目中遇到了,就是由于https证书链不完整引起的. 好吧,其实压 ...

  9. s21day07 python笔记

    s21day07 python笔记 一.昨日内容回顾及补充 回顾 补充 将前面所提到的功能,统一改称为方法 二.深浅拷贝 基本格式 v1 = [1,2,3] import copy v2 = copy ...

  10. Python全栈之路----函数进阶----作用域的查找空间

    n = 10 def func(): n = 20 print('func:',n) def func2(): n = 30 print('func2:',n) def func3(): print( ...