92SlidingDrawer控件介绍

来源:互联网 发布:耐克淘宝店装修风格 编辑:程序博客网 时间:2024/06/05 05:49

SlidingDrawer和SlidingMenu差不多,只是功能比SlidingMenu弱一点,稍作介绍:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical" >    <View        android:layout_width="match_parent"        android:layout_height="300dp" />    <SlidingDrawer        android:id="@+id/my_drawer"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:content="@+id/my_content"        android:handle="@+id/my_handle"        android:orientation="horizontal" >        <LinearLayout            android:id="@id/my_handle"            android:layout_width="wrap_content"            android:layout_height="match_parent"            android:orientation="vertical" >            <ImageView                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:src="@drawable/icon" />        </LinearLayout>        <LinearLayout            android:id="@id/my_content"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="#88000000"            android:gravity="center"            android:orientation="horizontal" >            <TextView                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="content" />        </LinearLayout>    </SlidingDrawer></LinearLayout>

必须指定handle和content下面的控件的id,就是此处指定的id.(为其孩子)

0 0
原创粉丝点击