Cannot drag DrawerLayout from list

I have the following layout MainActivity

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <FrameLayout
        android:id="@+id/fragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#EAEAEA" />

    <LinearLayout
        android:id="@+id/navigation_drawer"
        android:layout_width="260dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#FFFFFF"
        android:clickable="true"
        android:orientation="vertical" >
    </LinearLayout>

</android.support.v4.widget.DrawerLayout>

fragmentI add in FrameLayout, containing ListView. The problem is that I cannot drag DrawerLayoutout ListViewonly if ListViewlong enough to scroll (vertically).

Everything works well for DrawerLayout, I tried to open it using openDrawer, and it works, I cannot open it by dragging it from ListView. Is there any way to fix this?

+4
source share
1 answer

I think you can solve your problem if you use RelativeLayout in your fragment and add ListView to this layout.

        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <ListView 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        />

       </RelativeLayout>

ListView , RelativeLayout, , , . , , , fill_parent, .

0

Source: https://habr.com/ru/post/1623551/


All Articles