安卓 DrawLayout侧滑
来源:互联网 发布:ios 数组转json字符串 编辑:程序博客网 时间:2024/05/28 15:36
DrawerLayout顾名思义就是一个管理布局的。使用方式可以与其它的布局类类似。
DrawerLayout带有滑动的功能。只要按照drawerLayout的规定布局方式写完布局,就能有侧滑的效果。
直接将DrawerLayout作为根布局,然后其内部第一个View为内容区域
第二个View为左侧菜单
第三个View为右侧侧滑菜单
当前第三个是可选的。
注意这个属性android:layout_gravity="start"里面左中右分别放三个layout就可以了,简单的说在最外层套一个Drawerlayout,然后左中右分别可设置三个布局了,当然记得加上layout_gravity属性,同时中间布局是不可滑动的,左右两边可以,当然你也可以只设置一边
?xml version="1.0" encoding="utf-8"?><android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.administrator.layout.avitivty.tableActivity" ><LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" android:background="@color/colorAccent" android:orientation="vertical" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <android.support.design.widget.TabLayout android:id="@+id/Tab_content" android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="1" /> <android.support.v4.view.ViewPager android:id="@+id/pager_content" android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="8" /></LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="right" android:background="@color/colorPrimaryDark" android:orientation="vertical" /></android.support.v4.widget.DrawerLayout>
阅读全文
0 0
- 安卓 DrawLayout侧滑
- drawlayout侧滑
- DrawLayout
- DrawLayout
- Drawlayout
- DrawLayout
- drawlayout
- DrawLayout的使用
- 抽屉效果(DrawLayout)
- drawlayout的使用
- DrawLayout 侧滑侧栏点击穿透
- drawlayout的使用
- drawlayout(二)
- Drawlayout 抽屉 禁用滑动
- DrawLayout侧拉
- DrawLayout的简单使用
- drawlayout侧拉
- DrawLayout的使用
- 关于AndroidPhone传输数据
- 反思
- 1452: 你家的狗有病吧
- javascript里将函数名字符串转为函数并执行
- GDI+将CDC中画好的图像,保存到文件中
- 安卓 DrawLayout侧滑
- 最长无重复子串
- 尾递归实现斐波那契数
- Kotlin基础
- 学习笔记--Java变量
- 1138. Postorder Traversal (25)
- C#和C++释放内存的区别
- Linux的基本开发工具
- 计算机科学与Python编程导论_MIT 学习笔记(二)