Android tablayout and toolbar
来源:互联网 发布:origin软件使用教程 编辑:程序博客网 时间:2024/06/18 01:46
Adroid tablayout and toolbar
http://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/
Toolbar back button.
You can add your own 'up' button in toolbar, after all it is just a ViewGroup.
You can customize toolbar as much as you want, in your toolbar.xml, or wherever you have defined android.support.v7.widget.Toolbar in your layout add your 'up' button like given below :
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:minHeight="?attr/actionBarSize" android:layout_height="?attr/actionBarSize" android:background="@drawable/color_toolbar" android:layout_width="match_parent"> <ImageButton android:id="@+id/upButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="uphandler" android:src="@drawable/backbutton" android:layout_gravity="end"/></android.support.v7.widget.Toolbar>
Now, define uphandler function in your activity to listen to this up button :
public void uphandler(View v){ this.finish(); // This will kill current activity, and if previous activity is still opened in background, it will come in front.}
0 0
- Android tablayout and toolbar
- Android ToolBar and Listview
- android Material Design之 ToolBar+TabLayout+recycleView的效果实现
- Android开发之给TabLayout加上能消失的ToolBar
- Toolbar TabLayout ViewPager
- Android Material Design(4) CoordinatorLayout,AppBarLayout,Toolbar以及TabLayout的使用
- Android TabLayout
- 5.x控件:Toolbar、TabLayout、CoordinatorLayout
- CoordinatorLayout、Tablayout、Toolbar简单组合使用
- Toolbar、TabLayout、ViewPager(Json解析版)
- NavigationView+ToolBar+TabLayout+ViewPager+Fragment综合使用
- ToolBar的使用详解及配合TabLayout
- CoordinatorLayout/AppBarLayout/Toolbar/TabLayout遮挡下方布局
- Android Toolbar
- android ToolBar
- android toolbar
- Android Toolbar
- Android ToolBar
- 数据库的内联接、外联接
- Binary Tree Level Order Traversal II
- C/C++中读写文件
- leetcode #89 in cpp
- Symmetric Tree
- Android tablayout and toolbar
- Canvas Transformation
- 项目团队数据库版本管理及发布探索
- LeetCode--No.274--H-Index
- 网站及服务器安全的建议
- JNI - AttachCurrentThread
- C语言面试题:打印下图规律的图形
- 多余元素删除之移位算法
- AndroidStudio导入Git Project