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 6838851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:38:49+00:00 2026-05-26T23:38:49+00:00

I try to place a ListView under a WebView , to do this I

  • 0

I try to place a ListView under a WebView, to do this I use the folloing xml code:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bg"
    android:orientation="vertical"
    android:scrollbars="vertical" >

    <LinearLayout
        android:id="@+id/main_layout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <WebView
            android:id="@+id/content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:cacheColorHint="#00000000"
            android:textColor="#FFDEC2" />

        <ListView
            android:id="@+id/comments"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent" >
        </ListView>
    </LinearLayout>

</ScrollView>

The code displays the content of the WebView and ListView correctly, but the ListView just has the high of about 1.5 times the ListView Item, so not the entire List is displayed but just the first Items.

I tried several combinations of android:layout_height="fill_parent" and android:layout_height="wrap_content" in the LinearLayout, WebView, ListView and the surrounding ScrollView, none of them worked.

  • 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-26T23:38:50+00:00Added an answer on May 26, 2026 at 11:38 pm

    You should use layout weights. It’s a way to use percentages to define your layout.

    In the following example, the ListView uses 60% of the space, and the WebView 40% :

    <LinearLayout
        android:id="@+id/main_layout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:weightSum="1.0" >
    
        <WebView
            android:id="@+id/content"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:cacheColorHint="#00000000"
            android:textColor="#FFDEC2"
            android:layout_weight=".40" />
    
        <ListView
            android:id="@+id/comments"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight=".60" >
        </ListView>
    </LinearLayout>
    

    Just change these percentages to whatever you want.

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

Sidebar

Related Questions

Probably this isn't the right place... but ill give it a try. I want
... I ask this mainly because when I try to use the update panel,
I can run this code in Android app (using PhoneGap adn jQuery Mobile) but
I have the following code where I try to place a JLabel in a
When I try to place an element on top of my jQuery Cycle element,
What is the proper place to explain error handling in a try-catch statement? It
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Try the following code public enum Color { Blue=1, Red=2, Green=3 } public List<Color>
I try to place UITabbar on iPhone window using CGRectMake. But I found that
I'm at loss at how to describe this without code, so here it goes:

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.