Android学习之简单使用toolBar
来源:互联网 发布:网络机顶盒小米盒子 编辑:程序博客网 时间:2024/06/04 18:44
最近在自己练习音乐播放器这个小项目,想尽量做得美观,之间使用actionBar,发现特别不方便,所以简单学习一下toolbar
想要使用toolbar,先要在manifest中不要actionbar
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/Theme.AppCompat.Light.NoActionBar" .....
然后在布局中添加toolbar
<android.support.v7.widget.Toolbar android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:id="@+id/toolbar" android:background="#fff" > <RelativeLayout android:layout_width="250dp" android:layout_height="match_parent" android:layout_gravity = "center_horizontal" > <ImageButton android:layout_width="30dp" android:layout_height="30dp" android:id="@+id/bendiyinyue" android:src="@drawable/yinyue1" android:layout_margin="10dp" /> <ImageButton android:layout_width="30dp" android:layout_height="30dp" android:layout_margin="10dp" android:id="@+id/wangluosousuo" android:src="@drawable/wangluo1" android:layout_centerHorizontal="true" /> /> <ImageButton android:layout_width="30dp" android:layout_height="30dp" android:layout_margin="10dp" android:id="@+id/sousuo" android:src="@drawable/sousuo1" android:layout_alignParentRight="true" android:layout_marginRight="100dp" /> </RelativeLayout> </android.support.v7.widget.Toolbar>
效果图:
另外一篇比较详细的ToolBar的使用:
(http://blog.csdn.net/mchenys/article/details/51533689)
阅读全文
0 0
- Android学习之简单使用toolBar
- Android之toolbar简单使用
- Android Toolbar简单使用
- Android之ToolBar使用
- android ToolBar 的简单使用
- Android ToolBar的简单使用
- Android之toolbar的使用
- Android之Toolbar的使用
- android之Toolbar使用详解
- Android之ToolBar的使用
- Android开发之ToolBar使用
- Android 开发之toolbar使用
- android之Toolbar使用详解
- 浅谈MaterialDesign之toolbar的简单使用
- Material Design之Toolbar的简单使用
- Android中toolbar的简单使用
- Android 5.0 Toolbar 的学习使用
- Android控件之Toolbar + DrawerLayout的使用
- Spring AOP概述
- Linux下cp目录下的带隐藏文件的子目录
- 让标题栏消失掉的办法
- es 性能优化 建议1
- 今天搞定个javaagent类加载和tomcat冲突问题
- Android学习之简单使用toolBar
- Fedora 26: Install Fedora 26
- 单链表排序问题(冒泡/快排【前后指针法】)
- Linux下多进程多线程的调试
- java8特性
- hdu 1698 Just a Hook (线段树)(第二部分 成段更新)
- Bootstrap(二)
- CheckBox初识
- 线性顺序链表简单实现