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>

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值