完美解决DrawerLayout抽屉实现不能点击后面的控件

完美解决DrawerLayout抽屉实现不能点击后面的控件_第1张图片

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    >
    
    <LinearLayout >

        ...
    LinearLayout>
    
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/drawer_layout"
        android:layout_width="275dp"
        android:layout_height="match_parent"
        android:layout_gravity="right"
        android:background="@color/white"
        android:clickable="true" --重点-->
    >
    RelativeLayout>

android.support.v4.widget.DrawerLayout>

出现问题是:点击右侧的抽屉菜单,事件确实被主界面上的控件响应.

解决办法:

 android:clickable="true"

你可能感兴趣的:(Android)