ScrollView Layout does not fill the whole screen
If i'm not mistaken, the ViewGroup
's height (LinearLayout
's height in your case), that is the (only) child inside a ScrollView
, is always interpreted as wrap_content, since that content can be larger than the ScrollView
's height (hence the scrollbars).
This also means that if the content is smaller, the ScrollView
's content (child) may not necessarily stretch to fill the screen.
In order to visually help you fix this, we need to see a screenshot of your problem.
Maybe setting android:fillViewport="true"
on the ScrollView
will fix your issue:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:fadeScrollbars="false"
android:scrollbars="vertical" >
In your ScrollView
add an attribute ie.
android:fillViewport="true"
inflater.inflate(R.layout.menu_content_main, container);
should be
inflater.inflate(R.layout.menu_content_main, container, false);