在Android中SlidingDrawer默认的手柄按钮,在抽屉的中心。是否有可能改变位置向左或向右..?如果可能,我怎么能做到这一点,安卓重力=左
未在按钮的工作
In default handle button in android SlidingDrawer in the centre of the drawer. Is it possible to change that position to left or right..? If it possible how can I do that, android:gravity="left"
is not work in the button.
把你的手柄在RelativeLayout的,并设置机器人:layout_alignParentRight =真上的手柄
Put your handle in a RelativeLayout, and set android:layout_alignParentRight="true" on the handle.
例如是这样的:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<SlidingDrawer android:id="@+id/drawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:handle="@+id/handle"
android:content="@+id/content">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/handle">
<ImageView android:src="@drawable/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
<LinearLayout
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#aaaa00" android:id="@+id/content">
<ImageView android:src="@drawable/icon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
</ImageView>
</LinearLayout>
</SlidingDrawer>
</FrameLayout>
上一篇:OnItemClickListener没有与复选框工作?复选框、工作、OnItemClickListener
下一篇:Android的 - 无法找到的图形页面为例com.google.settings供应商信息为例、图形、供应商、页面