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

The Archive Base Latest Questions

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

I have a layout that looks like the following like below. My problems is

  • 0

I have a layout that looks like the following like below.
My problems is that on small screens, the button at the bottom of the view gets pushed of out view for the user. I thought i could easily remedy this by wraping the whole layout in a ScrollView, but I´ve since learned that this is not a feasible solution since there is a ListView in my layout.

So, any suggestions on how to change this layout? My main issue is really that I have an adapter connected to the ListView, and I´m not sure if I can redo the layout and use the adapter. Thoughts anyone?

Regards
Daniel

BTW, here´s my layout:

<?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"
    style="@style/defaultBackground" 
    >
    <LinearLayout 
        android:layout_height="wrap_content" 
        android:layout_width="fill_parent" 
        android:orientation="horizontal"
        android:paddingBottom="10dip"
        >
        <TextView 
            android:id="@+id/roundInfo" 
            android:layout_width="wrap_content" 
            android:layout_height="20dip" android:textColor="#000" 
            />
        <TextView 
            android:id="@+id/balance" 
            android:layout_width="fill_parent" 
            android:layout_height="20dip" 
            android:gravity="right" 
            android:textColor="#000" 
            />
    </LinearLayout>

    <ListView 
        android:id="@android:id/list"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" 
        android:textSize="10sp" 
        android:layout_height="fill_parent" 
        android:layout_weight="1"
        android:listSelector="@drawable/custom_row"
        android:background="@drawable/custom_listview"
        android:dividerHeight="0dip"
        android:cacheColorHint="#FFFFFF"
        android:fadingEdge="none"
        android:divider="#FFFFFF" 
        />
    <TextView 
        android:id="@+id/gameCost" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:text="@string/gameCost_not_finished"
        android:textColor="#000"  \
        android:paddingTop="10dip"
        />
    <Button 
        android:id="@+id/update_button" 
        android:text="@string/placebet_button"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        style="@style/whiteText" 
        android:background="@drawable/custom_button" 
        />
</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-18T19:38:49+00:00Added an answer on May 18, 2026 at 7:38 pm

    For this type of situation, you should use a RelativeLayout instead of a LinearLayout. Try 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"
        style="@style/defaultBackground" 
        >
        <LinearLayout 
            android:id="@+id/header"
            android:layout_height="wrap_content" 
            android:layout_width="fill_parent"
            android:layout_alignParentTop="true" 
            android:orientation="horizontal"
            android:paddingBottom="10dip"
            >
            <TextView 
                android:id="@+id/roundInfo" 
                android:layout_width="wrap_content" 
                android:layout_height="20dip" android:textColor="#000" 
                />
            <TextView 
                android:id="@+id/balance" 
                android:layout_width="fill_parent" 
                android:layout_height="20dip" 
                android:gravity="right" 
                android:textColor="#000" 
                />
        </LinearLayout>
    
        <LinearLayout
            android:id="@+id/footer"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="vertical"
            >
            <TextView 
                android:id="@+id/gameCost" 
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text="@string/gameCost_not_finished"
                android:textColor="#000"  
                android:paddingTop="10dip"
                />
            <Button 
                android:id="@+id/update_button" 
                android:text="@string/placebet_button"
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                style="@style/whiteText" 
                android:background="@drawable/custom_button" 
                />
        </LinearLayout>
    
        <ListView 
            android:id="@android:id/list"
            android:layout_width="fill_parent" 
            android:textSize="10sp" 
            android:layout_height="fill_parent" 
            android:layout_above="@id/footer"
            android:layout_below="@id/header"
            android:listSelector="@drawable/custom_row"
            android:background="@drawable/custom_listview"
            android:dividerHeight="0dip"
            android:cacheColorHint="#FFFFFF"
            android:fadingEdge="none"
            android:divider="#FFFFFF" 
            />
    </RelativeLayout>
    

    Basically, change your root layout to a RelativeLayout, and separate your content into three areas: header, body, footer. Keep your header as is, inside the horizontal LinearLayout, and set it to alignParentTop. Since it’s only set to wrap_content, we don’t have to worry about weights or anything. Then, place the other fixed items that should be on bottom (the gameCost text and the placeBet button) into a vertical LinearLayout that serves as a footer. Set it to alignParentBottom. Finally, declare your ListView with a height of fill_parent. This will take the remaining space, but to keep it within the bounds of your header and footer, we add the layout_above and layout_below parameters. Hope this helps!

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

Sidebar

Related Questions

I have a layout that looks like the following: Ext.Viewport{ Ext.Panel{ Ext.Panel{ Ext.TabPanel{ Ext.Panel{
I have a basic website nav layout that looks like this: <li class=folder parent_folder>
I have a button that basically looks like this: <Button android:id=@+id/admin_new_questions android:layout_width=fill_parent android:layout_height=wrap_content android:text=See
I have a HorizontalScrollView in Android that looks like the following in the xml.
I have a layout that looks like this <div class=categoery> <span>categorie title</span> <table> <tr
I have an GLSL geometry shader that looks like the following: #version 150 uniform
I have a Listview that looks like the following: checkbox:textview {0 .. n} I
I want to produce an Android screen layout that looks something like the following:
I am trying to make it such that the layout looks like the following
I have a layout that uses a scroll view. The first part of the

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.