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

  • Home
  • SEARCH
  • 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 7641479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:56:02+00:00 2026-05-31T08:56:02+00:00

I have a layout and I want the components to fill up the remaining

  • 0

I have a layout and I want the components to fill up the remaining part of the screen (using weights). The Listview works perfectly.

The 2 buttons at the end work the way I intent them to work also, however I get a warning which says “Nested weights are bad for performance”.

I think it’s a problem because I already used a weight parameter for the Listview, because when I remove the listview the warning is gone.

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <ListView
            android:id="@+id/listMessages_messages"
            android:layout_width="fill_parent"
            android:layout_height="0dp"
            android:layout_marginBottom="5dip"
            android:layout_marginLeft="10dip"
            android:layout_marginRight="10dip"
            android:layout_marginTop="10dip"
            android:layout_weight="1"
            android:background="#000000" >
        </ListView>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <Button
                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_weight="50"
                android:visibility="invisible" />

            <Button
                android:id="@+id/btnNewConversation_message"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginRight="5dip"
                android:layout_weight="50"
                android:onClick="newConversation"
                android:text="@string/NewConversation" />
        </LinearLayout>

    </LinearLayout>
  • 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-31T08:56:03+00:00Added an answer on May 31, 2026 at 8:56 am

    Check this code. Im not getting warning

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent" android:layout_height="fill_parent"
        android:orientation="vertical"
        android:weightSum="10">
        <ListView android:id="@+id/listMessages_messages"
            android:layout_width="fill_parent" android:layout_height="0px"
            android:layout_marginBottom="5dip" android:layout_marginLeft="10dip"
            android:layout_marginRight="10dip" android:layout_marginTop="10dip"
            android:layout_weight="8" android:background="#000000">
        </ListView>
        <LinearLayout android:layout_width="fill_parent"
            android:layout_height="0px" android:orientation="horizontal"
            android:weightSum="10" android:layout_weight="2">
            <Button android:layout_width="0px"
                android:layout_height="wrap_content" android:layout_weight="5"
                 />
            <Button android:id="@+id/btnNewConversation_message"
                android:layout_width="0px" android:layout_height="wrap_content"
                android:layout_marginRight="5dip" android:layout_weight="5"
                android:onClick="newConversation"  />
        </LinearLayout>
    </LinearLayout> 
    

    As you placing both views
    1.List View
    2.Linear Layout (Two buttons)
    you need to give weight property to adjust them properly and for horizontal divison for buttons also give some weight sum property to second linear layout divide it equally using weights. note within second linear layout i used width for buttons to 0px

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

Sidebar

Related Questions

I have an XML layout and want to add my own custom SurfaceView to
I have a layout like this in which I want to display a label
a have three column layout and i want to have three divs inside the
I have a layout with three elements and its orientation is 'horizontal' I want
I have a layout that contains two ImageViews. I want one of them to
I want my app to have a specific layout for Android tablets and another
I have jQuery load asset on my layout and I want to use CHtml::ajaxButton/ajaxSubmitButton
I want to have a 2 column layout, and have the left column able
I have a viewflipper that I want to populate with the same layout multiple
I have a partial that I want to display in a layout only when

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.