Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4013016
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:19:08+00:00 2026-05-20T09:19:08+00:00

I am trying to setup an activity in Android that has 50% of the

  • 0

I am trying to setup an activity in Android that has 50% of the screen hight for a ScrollView and the other 50% for a ListView.

To do this I have set the weight of each to “1”.

Like This:

<LinearLayout android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:padding="10dip">


    <ScrollView android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_weight="1">

        <TableLayout android:id="@+id/my_table"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:shrinkColumns="0">

            <TableRow android:padding="5dip"
        android:id="@+id/fault_heading"
        android:layout_width="fill_parent"
            android:layout_height="wrap_content">

            <TextView android:layout_width="fill_parent"
            android:layout_height="wrap_content"
        android:text="@string/table_title"
        android:paddingRight="20dip"/>

            </TableRow>
            <!-- More rows are added at run time. -->

        </TableLayout>

    </ScrollView>

    <ListView android:id="@+id/comments"
              android:layout_width="fill_parent"
              android:layout_height="0dip"
          android:layout_weight="1"></ListView>

</LinearLayout>

When both the ScrollView and the ListView have too much content to display without scrolling this works perfectly.

When the ScrollView only needs 20% of the screen and the ListView needs 70% the ListView grows to 70% so it can display without scrolling. This is not what I expected to happen but is good.

The problem I have is when the ListView has so much data that it would need the whole screen to display AND the Scroll view only 1 or 2 rows of data in it. In this case the ListView grows to take up almost the full height and leaves space equivalent to about one line of text for the scroll view.

I can’t seem to get my head around how to reserve a certain proportion of the screen for the ScrollView no matter how big the ListView gets.

The amount of space the ScrollView can grab seems directly proportional to the number of rows in it’s child table. When this is only 1 the scroll view is only about half a cm in height.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:19:09+00:00Added an answer on May 20, 2026 at 9:19 am

    What about changing android:layout_height for to be a minimum value instead of 0dip?

    UPDATED: As per the comments below the solution was to set the outer LinearLayout to have height “fill_parent”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android app with a screen that comprises of a ListView, which
I have several ListActivties set up in my Android Application. What I am trying
I'm trying to create a setup activity for my Android application which my users
I'm trying to set a custom font on a list activity in Android. I
I have a C++ Android application that I'm trying to debug with ndk-gdb. The
I've been trying to use an android preference activity, I got it all set
I noticed that the Android Developers Activity section has been updated since I started
I have a simple application that starts with a splash screen activity that plays
I have been trying to setup git for our web development team unsuccessfully. Some
I'm trying to setup the application server part of C2DM push messaging using this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.