| java.lang.Object | |||
| ↳ | android.view.View | ||
| ↳ | android.view.ViewGroup | ||
| ↳ | android.widget.SlidingDrawer | ||
Class Overview
SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen.
SlidingDrawer包含屏幕之外的内容,并且允许用户通过拖拉手柄把这些内容带到屏幕上面。
SlidingDrawer can be used vertically or horizontally.
SlidingDrawer可以设置为垂直或者水平状态。
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.
SlidingDrawer应该用来做为内部布局的覆盖。
This means SlidingDrawer should only be used inside of a FrameLayout or a RelativeLayout for instance.
这意味着SlidingDrawer应该成为一个FrameLayout或者RelativeLayout的内部的一个实例。
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.
这个SlidingDrawer的尺寸决定了它包含的内容一旦滑出来占用了多少空间,因此SlidingDrawer应该通常把它的尺寸都设置为match_parent。
Inside an XML layout, SlidingDrawer must define the id of the handle and of the content:
在一个xml文件中,SlidingDrawer类必须定义手柄的id及内容的id,如下所示:
<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>
Summary
本文深入探讨了Android Sliding Drawer组件的使用方法,包括其基本概念、如何在XML布局中配置,以及如何实现垂直和水平状态。重点介绍了组件的工作原理、属性设置以及常见用法。
6228

被折叠的 条评论
为什么被折叠?



