I have a main ScrollView and then I have a child LinearLayout and that has ListView in it. I'm not sure why it is not scrolling. I read about how listview should not be inside scroll view, but I need my layout to scroll and then view the listview. I'm not sure if this is the proper approach. Please direct.
This works on my tablet with a large screen but not on my phone which has a smaller screen and you need to scroll to view the listview completely. The listview works if I use linear layout but then I don't see the listview completely because its on the bottom of the layout.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true" >
<LinearLayout
android:id="@+id/user_info"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:paddingTop="46dp"
android:paddingLeft="24dp"
android:paddingRight="24dp" >
<Spinner
android:id="@+id/userTypeSpinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<EditText android:id="@+id/fname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="First Name"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" >
<EditText android:id="@+id/lname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="Last Name"/>
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:id="@+id/staff_username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone" >
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" >
<EditText android:id="@+id/uname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="Username"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/staff_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone" >
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" >
<EditText android:id="@+id/upassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="Password"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/staff_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="gone" >
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" >
<EditText android:id="@+id/uemail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:hint="Email"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/staff_permissions"
android:layout_marginTop="8dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
>
<ListView
android:id="@+id/permission_list"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:fadeScrollbars="false"
/>
</LinearLayout>
<android.support.v7.widget.AppCompatButton
android:id="@+id/addUserBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
android:padding="12dp"
android:text="@string/add_new_user"/>
</LinearLayout>