您的位置:首页 > 移动开发 > Android开发

android界面 slidingdrawer抽屉 从左侧拉出效果

2010-09-28 15:02 549 查看
SlidingDrawer默认vertical效果为从底侧拉出。horizontal默认为从右侧拉出。而我想实现的是在左侧布局的抽屉。最后,我没能找到slidingDrawer的任何属性可以控制其变为左侧拉出。最后在一个高手的程序上做了一定的修改,实现了我想要的效果。

<SlidingDrawer

android:id="@+id/slidingdrawer"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="horizontal"

android:handle="@+id/handle"

android:content="@+id/content">

<LinearLayout

android:id="@id/handle"

android:layout_width="40dip"

android:layout_height="64dip"

android:background="#ff0000FF" />

<LinearLayout

android:id="@id/content"

android:layout_width="200dip"

android:layout_height="fill_parent"

android:background="#ff00FF00"

>

<Button

android:id="@+id/button1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Button"/>

<EditText

android:id="@+id/editText"

android:layout_width="fill_parent"

android:layout_height="wrap_content"/>

</LinearLayout>

</SlidingDrawer>

该控件实现了从右向左拉出效果。

从左向右拉出效果,借用这个控件,写一个panel类,在这个类上实现。代码不用搞懂,只要把这个panel类导进去,学会使用就行啦。



这是界面效果,this有响应事件。

程序下载链接:http://download.csdn.net/source/2724111
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: