设为首页 加入收藏

TOP

【Android】抽屉控件 SlidingDrawer 的简单示例
2014-11-24 14:30:30 来源: 作者: 【 】 浏览:0
Tags:Android 抽屉 控件 SlidingDrawer 简单 示例

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】简单的说就是:


SlidingDrawer是一个可以实现抽取式显示的控件,可以垂直,水平拉取,每个抽屉都包含两个东西:一个是拉手(handle),一个是抽屉里面的东西(content),SlidingDrawer需要放置在另外的一个layout之上,这意味着SlidingDrawer只能放置在 FrameLayout or a RelativeLayout里面。SlidingDrawer需要设置宽高为match_parent,而且在SlidingDrawer里面必须设置handle与content(显然,不然缺少任何一个都不叫“抽屉”啊)




【2】一些重要的属性与方法:









【4】Demo演示:





这里使用到了标签,详细使用方法请看;http://developer.android.com/resources/articles/layout-tricks-merge.html


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇自己动手写最简单的Android驱动--.. 下一篇NDK编译出的apk文件安装到Android..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: