一.简单示例
src不变
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="欢迎进入最简单的抽屉类实例" >
</TextView>
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:content="@+id/content"
android:orientation="horizontal"
android:handle="@+id/handle" >
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Handle" />
<LinearLayout
android:id="@+id/content"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
</SlidingDrawer>
</LinearLayout>
二. 结果
启动

点击Handle按钮

本文介绍如何在Android中使用SlidingDrawer组件创建一个简单的抽屉类实例,包括XML布局文件配置和点击按钮触发滑动效果。
395

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



