Android DrawerLayout侧滑页面点击事件无响应注意事项

直接上代码

 <android.support.v4.widget.DrawerLayout
        android:id="@+id/drl"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        
        <RelativeLayout
            android:id="@+id/rl_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <include android:id="@+id/toolbar"
                layout="@layout/toorbar_main">include>
            <RelativeLayout
                android:id="@+id/rl_webview"
                android:layout_below="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
            RelativeLayout>
        RelativeLayout>
        
        <RelativeLayout
            android:id="@+id/rl_menu"
            android:clickable="true" 
            android:background="@color/bg_color"
            android:layout_gravity="left"
            android:layout_width="200dp"
            android:layout_height="match_parent"
            >

            <TextView
                android:id="@+id/tv_scan"
                android:layout_gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:layout_marginTop="60dp"
                android:text="扫码"
                android:textColor="@color/header"

                />

            <View
                android:id="@+id/v_line"
                android:layout_below="@+id/tv_scan"
                android:background="@color/grgray"
                android:layout_width="match_parent"
                android:layout_marginLeft="10dp"
                android:layout_height="1dp">View>

            <TextView
                android:id="@+id/tv_recognition"
                android:layout_below="@+id/v_line"
                android:layout_gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:text="名片识别"
                android:textColor="@color/header"
                />

        RelativeLayout>

官方有说侧滑的页面一定要放在主页面底部,但是~写布局时按照习惯肯定是放主页面上面~

你可能感兴趣的:(Android,开发随笔)