Android DrawerLayout基础
来源:互联网 发布:一加5 小米6 知乎 编辑:程序博客网 时间:2024/05/17 19:58
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="${relativePackage}.${activityClass}" > <TextView android:layout_width="fill_parent" android:layout_height="50dp" android:background="@android:color/darker_gray" /> <android.support.v4.widget.DrawerLayout android:id="@+id/drawerlayout" android:layout_width="match_parent" android:layout_height="match_parent" > <FrameLayout android:id="@+id/contentFrame" android:layout_width="match_parent" android:layout_height="match_parent" > </FrameLayout> <ListView android:id="@+id/listview" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#ffffcc" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" > </ListView> </android.support.v4.widget.DrawerLayout></LinearLayout>
android.support.v4.widget.DrawerLayout里面第一个是主布局
第二个是抽屉布局
DrawerLayout的关闭和打开是事件是DrawerListener;
drawerLayout.setDrawerListener(new DrawerListener() { @Override public void onDrawerStateChanged(int arg0) { // TODO Auto-generated method stub } @Override public void onDrawerSlide(View arg0, float arg1) { // TODO Auto-generated method stub } @Override public void onDrawerOpened(View arg0) { // TODO Auto-generated method stub } @Override public void onDrawerClosed(View arg0) { // TODO Auto-generated method stub } });
0 0
- Android DrawerLayout基础
- <Android 基础(七)> DrawerLayout and NavigationView
- Android DrawerLayout
- Android -- DrawerLayout
- android drawerlayout
- android drawerlayout
- android DrawerLayout
- Android drawerlayout 点击菜单栏 drawerlayout 关闭
- Android DrawerLayout抽屉效果
- Android DrawerLayout抽屉效果
- Android DrawerLayout 侧滑
- ANDROID drawerlayout+fragment侧滑
- Android - DrawerLayout的使用
- Android DrawerLayout 抽屉
- Android studio DrawerLayout
- Android-DrawerLayout介绍
- android的DrawerLayout
- Android UI之DrawerLayout
- LeetCode Search a 2D Matrix II
- 构建战略网络防御:网络曼哈顿计划蓝图
- Windows下安装黑苹果(OS X Mavericks)的错误总结
- java对象转json, 数字精确出现丢失
- java基础 数组的增添改查
- Android DrawerLayout基础
- linux-command-ps
- 无限的崇拜
- C++ MyString类的简单实现
- TyvjOJ 题目P1039 忠诚2(线段树单点跟新,区间最小值)
- cdh agent 安装
- 2.2.5、自动启动容器
- 正则表达式
- Mybatis