SlideMenuLayout
SlideMenuLayout copied to clipboard
无法获取主视图contentView,设置contentToggle为true时点击了主视图的空白处无法关闭侧滑菜单
无法获取主视图contentView,设置contentToggle为true时点击了主视图的空白处无法关闭侧滑菜单
<?xml version="1.0" encoding="utf-8"?>
<com.jkb.slidemenu.SlideMenuLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.eendtech.www.slidemenuexample.MainActivity"
android:id="@+id/mainSlideMenu"
android:background="#fff"
app:slideMode="left"
app:parallax="false"
>
<include layout="@layout/menu_left"/>
<LinearLayout
android:id="@+id/menu_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
/>
</LinearLayout>
</com.jkb.slidemenu.SlideMenuLayout>
之前用的也是两个include标签,查看源码后发现获取布局采用的是getChildAt(),但是经过断点发现没有值传进来
https://github.com/JingYeoh/SlideMenuLayout/issues/17 我也遇到了这个问题, 用onTouchListener解决了 @zangxiyang321