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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:44:42+00:00 2026-06-11T13:44:42+00:00

How to tell Android relative layout to take all space left between two elements.

  • 0

How to tell Android relative layout to take all space left between two elements. Does not matter how much is that space.

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



<TableLayout android:layout_below="@id/title_container"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id = "@+id/usb_config_title">

    <TableRow android:layout_gravity="center_horizontal">
        <TextView android:layout_width="398dp"
            android:layout_height="4px"
            android:text="     "/>
        <TextView android:layout_width="4px"
            android:layout_height="4px"
            android:text="     "
            android:background="@color/title_background"/>
        <TextView android:layout_width="398dp"
            android:layout_height="4px"
            android:text="     "/>
    </TableRow>


    <TableRow android:layout_gravity="center_horizontal">
        <TextView android:text="@string/usb_stick"
            android:layout_width="398dp" 

            android:gravity="center"
            android:layout_height="wrap_content"
            android:textSize="22dp"/>
        <TextView android:layout_width="4px"
            android:layout_height="fill_parent"
            android:text="     "
            android:background="@color/title_background"/>
        <TextView android:text = "@string/usb_internal_memory"

        android:layout_width="398dp" 
            android:gravity="center"
                android:layout_height="wrap_content"
            android:textSize="22dp"/>
    </TableRow>

    <TableRow android:layout_gravity="center_horizontal">
        <TextView android:layout_width="398dp"
            android:layout_height="5px"
            android:text="     "/>
        <TextView android:layout_width="4px"
            android:layout_height="5px"
            android:text="     "
            android:background="@color/title_background"/>
        <TextView android:layout_width="398dp"
            android:layout_height="5px"
            android:text="     "/>
    </TableRow>
</TableLayout>


<LinearLayout android:orientation="horizontal"
            android:layout_below="@id/usb_config_title"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >
    <ListView
        android:id="@+id/list3"
        android:layout_width="398px"
        android:layout_height="wrap_content"

        android:drawSelectorOnTop="false"
        android:scrollbarAlwaysDrawVerticalTrack="true"
    />

    <TextView android:layout_width="4px"
        android:layout_height="fill_parent"
        android:text="     "
        android:background="@color/title_background"/>
    <ListView
        android:id="@+id/list4"
        android:layout_width="398px"
        android:layout_height="wrap_content"
        android:drawSelectorOnTop="false"
        android:scrollbarAlwaysDrawVerticalTrack="true"
    />
</LinearLayout>
<include layout="@layout/buttons_bottom_with_relative"/>      
</RelativeLayout>

So i need id/list3 to last till button bar which is. At the moment id/list3 is covered by button bar.

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:gravity="bottom"
            android:layout_weight="1"
    android:id="@+id/controls" 
    android:orientation="horizontal"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:baselineAligned="false"
    style="@android:style/ButtonBar"
    android:background="@drawable/bottom_layout_selector"
>
    <Button 
        android:layout_width="100px" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/startButton"
        android:text="@string/start" 
        android:visibility="invisible"
    />

    <Button 
        android:layout_width="100px" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/stopButton"
        android:text="@string/stop" 
        android:visibility="invisible"
    />

    <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/nextButton"
        android:text="@string/next"
        android:visibility="invisible"
    />

    <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/resetStatistics"
        android:text="@string/reset_statistics"
        android:visibility="invisible" 
    />

    <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/histogramSettings"
        android:text="@string/histogram_settings"
        android:visibility="invisible" 
    />

    <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/saveButton"
        android:text="@string/save"
        android:visibility="invisible"
    />

    <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/loadConfig"
        android:text="@string/load_config"
        android:visibility="invisible" 
    />

    <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_weight="1" 
        android:id="@+id/saveConfig"
        android:text="@string/save_config"
        android:visibility="invisible" 
    />

</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-06-11T13:44:43+00:00Added an answer on June 11, 2026 at 1:44 pm

    Have you tried adding this to the linear layout that includes list3

        android:layout_below="@id/usb_config_title"
        android:layout_above="@id/controls"
    

    So the linear layout positions itself between those two.

    I don’t think you can use the weight attribute for Relative layouts. If you align one layout to the top of the screen and one to the bottom then tell the one in the middle to above and below the other two it should fill in the space

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

Sidebar

Related Questions

How can I tell android to not crop my layout when displaying the on-screen
EDIT: Does TableLayout not work properly? I see most of you say use relative
Does PhoneGap (more specifically DroidGap for Android) have way to tell when its webview
Can someone please tell me why this GridView does not scroll smoothly even when
Is there any way to programmatically tell android to open the keyboard when the
As I understand it, if I don't explicitly tell Android that I want to
I user android/proguard/ACRA. Can anyone tell me please why the crash reports I am
I want to develop android based application in c#.Can anyone tell me where can
Can anyone tell me about the below warning refers to in android eclipse. Keybinding
can anybody tell How to dispaly gradient effect from top to bottom in android

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.