Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Scrollview pushes entire layout to half view size?

I've got a layout like so..

<LinearLayout android:id="@+id/LinearLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:background="#333333" android:orientation="vertical" android:layout_width="match_parent">
<ScrollView android:layout_width="match_parent" android:id="@+id/scrollView1" android:layout_height="match_parent">
    <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
        <FrameLayout android:layout_width="fill_parent" android:layout_height="45dip" android:id="@+id/frameLayout1">
            <EditText android:autoText="true" android:text="EditText" android:hint="@string/searchBox" android:singleLine="true" android:layout_height="fill_parent" android:id="@+id/qbox" android:layout_width="fill_parent"></EditText>
            <Button android:layout_height="fill_parent" android:text="Button" android:layout_width="45dip" android:background="@drawable/search" android:layout_gravity="right" android:id="@+id/search"></Button>
        </FrameLayout>
        <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">
            <LinearLayout android:id="@+id/linearLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center">
                <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingRight="5dip" android:id="@+id/logo" android:src="@drawable/icon" android:paddingLeft="10dip"></ImageView>

            </LinearLayout>
            <com.app.org.HorizontialListView android:layout_width="wrap_content" android:layout_height="150dip" android:id="@+id/hlist" android:background="#FFFFFF"></com.app.org.HorizontialListView>
        </LinearLayout>
        <LinearLayout android:layout_width="fill_parent" android:layout_height="40dip" android:paddingLeft="15dip" android:id="@+id/buttonlist" style="@style/tabBar"></LinearLayout>
        <ListView android:layout_width="fill_parent" android:background="#FFFFFF" android:id="@+id/searchresults" android:cacheColorHint="#ffffff" android:layout_height="match_parent" android:scrollbars="none"></ListView>
    </LinearLayout>
</ScrollView>
</LinearLayout>

I just added the ScrollView but it appears to push my entire layout into taking up about half the screen size for some reason.. anyone got any Idea why?

Below is an illustration of the affect adding the Scrollview had on the Layout.

Layout before ScollView
|---------------------|
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|---------------------|

Layout after ScollView
|---------------------|
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|                     |
|---------------------|
like image 515
Skizit Avatar asked Nov 27 '22 22:11

Skizit


1 Answers

Try to set Full Viewport = true on the scroll view

like image 94
BFil Avatar answered Nov 30 '22 12:11

BFil