Let me introduce you to my activity:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/toolbar_actionbar"
layout="@layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@+id/main_fragment_container"
android:layout_width="match_parent"
android:layout_below="@+id/toolbar_actionbar"
android:layout_height="match_parent"/>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar_actionbar">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:clickable="true"
android:layout_height="match_parent"/>
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id="@+id/fragment_drawer"
android:name="com.package.name.navigationdrawer.NavigationDrawerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="@layout/fragment_navigation_drawer"/>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
FrameLayout main_fragment_container is where I load different fragments depending on Navigation Drawer selections but when I load a fragment with a ScrollView scroll does not work, I can see the scrollbar when the fragment is loaded indicating that only a small section is on screen at the moment but it will never scroll. I tried some suggestions that mentioned encasing the ScrollView inside a LinearLayout, it made no difference.
I suspect the navigation drawer is "intercepting" the events which should reach the ScrollView but I'm lost as to what to do. This is the fragment:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<ScrollView
android:id="@+id/fragment_who_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/header_pic_s"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
Thanks for your time.
UPDATE - LET ME ADD SOME ADDITIONAL INFO:
The problem here is not the ScrollView per se but the fact that in my activity layout the DrawerLayout is 'above' the ScrollView preventing any touch events reaching the ScrollView. If I remove the DrawerLayout the ScrollView scrolls JUST FINE.
Similarly if I put ScrollView after DrawerLayout in activity layout the scroll works alright in the ScrollView but of course the DrawerLayout does not work as intended since it must be on top of everything else.
I hope I explained myself properly, by testing I'm sure of what the problem is but I'm not sure on how to fix it, my experience with Navigation Drawer is limited and I have no idea how to let the scroll event pass to the ScrollView instead of having the DrawerLayout intercept it.
You should move the framelayout with id "main_fragment_container" inside drawerlayout like this: