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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:59:32+00:00 2026-05-25T16:59:32+00:00

I am trying to create the following layout. +———————+ | Text View | +———————+

  • 0

I am trying to create the following layout.

+---------------------+
|     Text View       |
+---------------------+
|                     |
|                     |
|    Custom View      |
|    Expands to       |
|    extra space      |
|                     |
+---------------------+
|Button1   |Button2   |
+---------------------+

My layout xml looks like the following.

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

    <TextView android:text="This is test text." android:id="@+id/statusTxt"
            android:layout_width="fill_parent" android:layout_height="wrap_content" />

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:id="@+id/gameView"
        android:layout_gravity="bottom">

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="horizontal" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:id="@+id/gameButtonView">

            <Button android:text="Done" android:id="@+id/doneBtn"
                android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>

            <Button android:text="Undo" android:id="@+id/undoBtn"
                android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

Than programatically I am adding my custom view

LinearLayout gameView = (LinearLayout)this.findViewById(R.id.gameView);
gameView.addView(gameBoardView, 1);

With the current layout it ends up looking like this.

+---------------------+
|     Text View       |
+---------------------+
|Button1   |Button2   |
+---------------------+
|                     |
|                     |
|    Custom View      |
|    Expands to       |
|    extra space      |
|                     |
+---------------------+

What this current layout does is it sticks the bottom buttons above the Custom View. Any ideas on how I can get it to render how I have described?

  • 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-25T16:59:33+00:00Added an answer on May 25, 2026 at 4:59 pm

    Use a RelativeLayout. Set your TextView to alignParentTop=”true”. Put your buttons in a LinearLayout with alignParentBottom=”true” and then set your content in the middle to above=”buttons” and below=”text”

    Something like this:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    
        <!-- Text at the top -->
        <TextView
            android:id="@+id/text"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true" />
    
        <!-- Your game play view -->
        <View
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_above="@+id/buttons"
            android:layout_below="@+id/text" />
    
        <!-- Buttons at the bottom -->
        <LinearLayout
            android:id="@+id/buttons"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true">
    
            <Button
                android:layout_weight="1"
                android:layout_width="0dip"
                android:layout_height="wrap_content" />
    
            <Button
                android:layout_weight="1"
                android:layout_width="0dip"
                android:layout_height="wrap_content" />
    
        </LinearLayout>
    
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create a list to return some JSON data to a view. Following
I am trying to create an XSD schema which will validate the following xml.
I'm trying to create a DialogFragment using a custom view in an AlertDialog .
I am trying to create a ListView using the following code: setListAdapter(new ArrayAdapter<String>(this, R.layout.settings_items,
I'm trying to create a layout that looks like a LI with a bullet,
I'm trying to create a TabActivity for my android application. When my layout XML
I'm trying to create a custom ListView layout similar to android.R.layout.simple_list_item_2. However, when I
im trying to create a Window with the following layout: Layout http://www.x-toolz.com/downloads/layout.jpg As you
I'm trying to create the following layout using CSS: Gray Rectangle = Container Blue
I'm trying to create the following layout for my website: <table width=80% align=center> <tr>

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.