滑动式抽屉_SlidingDrawer
来源:互联网 发布:自学美工要下什么软件 编辑:程序博客网 时间:2024/04/29 13:09
http://developer.android.com/reference/android/widget/SlidingDrawer.html
应用场景:从下边或者右边拖出或弹出一个控件,提供操作快捷方式;
问题:滑动抽屉由什么组成?把手和隐藏控件;handle and content
思考:1.抽屉的把手用什么做?drag a handle to bring the content on screen
2.隐藏控件用什么做?SlidingDrawer hides content out of the screen
3.滑动抽屉有什么监听器?
总之都是view对象,handle可以用ImageView来做,也可用TextView来做,毕竟它们都是view的子类;
content也一样,可以装一个GridView 也可以是一个ListView,也可以是一个LinearLayout,其中有多个View对象;
监听器:滑动时 OnDrawerScrollListener
打开时 OnDrawerOpenListener
关闭时 OnDrawerCloseListener
接口简介:
类的简介:
SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen. SlidingDrawer can be used vertically or horizontally. A special widget composed of two children views: the handle, that the users drags, and the content, attached to the handle and dragged with it. SlidingDrawer should be used as an overlay inside layouts. This means SlidingDrawer should only be used inside of a FrameLayout or a RelativeLayout for instance. The size of the SlidingDrawer defines how much space the content will occupy once slid out so SlidingDrawer should usually use match_parent for both its dimensions. Inside an XML layout, SlidingDrawer must define the id of the handle and of the content:
操作步骤:
1.在布局文件中,配置对象,该对象应该放在FrameLayout或RelativeLayout中;
<SlidingDrawer android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:handle="@+id/handle" android:content="@+id/content"> <ImageView android:id="@id/handle" android:layout_width="88dip" android:layout_height="44dip" /> <GridView android:id="@id/content" android:layout_width="match_parent" android:layout_height="match_parent" /> </SlidingDrawer>2.在程序代码中,设置监听,获取控件,设置监听;
- 滑动式抽屉_SlidingDrawer
- 滑动式抽屉(SlidingDrawer)
- SlidingDrawer(滑动式抽屉)
- android 抽屉式滑动demo
- Android Apps 滑动式抽屉(SlidingDrawer)效果
- android SlidingDrawer滑动式抽屉控件
- Andrid滑动式抽屉 SlidingDrawer
- Android开发之SlidingDrawer(滑动式抽屉)
- Android SlidingDrawer(滑动式抽屉)
- SlidingDrawer滑动抽屉
- android抽屉+滑动
- SlidingDrawer滑动抽屉
- Android 滑动抽屉
- SlidingDrawer滑动抽屉
- Drawlayout 抽屉 禁用滑动
- 与数据库联动的抽屉式滑动菜单(二级)
- 滑动式抽屉布局界面SlidingDrawer的简单使用
- Android控件之SlidingDrawer(滑动式抽屉)
- 记数排序
- 了解lambda函数
- 再谈软件保护中软加密和硬加密的安全强度
- strncmp函数
- asp.net中ObjectDataSource的参数值和GridView联合使用
- 滑动式抽屉_SlidingDrawer
- Unix环境高级编程学习笔记(十一) 网络IPC:套接字
- 方块总动员消图算法(Objective-c)
- 数据结构之各种排序的比较
- 串口通信编程 资料参考地址
- 如何提高Java程序性能?
- unix环境高级编程编译方法 -apue最简单编译方法
- Ubuntu Linux 下编译安装 PostgreSQL 和 pgAdmin
- rawQuery()方法的使用