以下是我的 XML:
<RelativeLayout 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"
tools:context=".Main"
android:background="@android:color/black" >
<RelativeLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageButton
android:id="@+id/calendar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/about"
android:layout_centerHorizontal="true"
android:background="@drawable/calendar" />
<ImageButton
android:id="@+id/okan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/calendar"
android:layout_marginLeft="20dp"
android:layout_toRightOf="@+id/calendar"
android:background="@drawable/okanliyiz"/>
<ImageButton
android:id="@+id/about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginTop="140dp"
android:layout_toLeftOf="@+id/calendar"
android:background="@drawable/info" />
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false" />
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
我编写了程序部分,
Drawer
已经可以正常工作,但是我无法点击它后面的ImageButton
。如果我把按钮放在前面,我就能够点击它们,但是抽屉就会被遮挡,这样看起来很糟糕。有什么解决方法吗?我怎样才能既点击抽屉后面的按钮又能看到抽屉在前面?谢谢您提前的帮助。
<DrawerLayout>
。如果我理解有误,那么请原谅,但我一直将这个问题用作类似问题的重复目标,并且刚刚才注意到这一点。 - Mike M.