一、抽屉特效展示
抽屉效果图如下,点击辅助工具后将展开抽屉内容:
二、抽屉示例代码
代码如下:
<SlidingDrawer xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/slidingdrawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:content="@+id/content"
android:handle="@+id/handle"
android:orientation="horizontal" >
<!--抽屉按钮图片-->
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/supplytool_tv_title"
android:background="@drawable/button_style_spin" />
<LinearLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true"
android:orientation="vertical" >
<!--内容区-->
</LinearLayout>
</SlidingDrawer>
三、抽屉问题总结
1、抽屉的上下、左右展示是通过orientation的属性控制的,可以为vertical和horizontal。其中vertical默认从下到上,horizontal为从右到左。