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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:15:59+00:00 2026-05-23T05:15:59+00:00

I have a ListView in a dialog and I need to show a button

  • 0

I have a ListView in a dialog and I need to show a button after the list.

<?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="wrap_content">  
<TextView   android:id="@+id/tvwGameOver" android:layout_weight="1" android:gravity="center"
            android:textSize="25sp" android:visibility="gone"
            android:layout_width="fill_parent" android:layout_height="wrap_content"/>
<LinearLayout 
  android:id="@+id/lloPlayerNames" xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent" android:layout_height="wrap_content" 
  android:orientation="horizontal" android:footerDividersEnabled="true"
  android:headerDividersEnabled="true" android:layout_below="@id/tvwGameOver">
  <TextView
    android:id="@+id/tvwGameNumberHeader" android:layout_weight="1" android:gravity="right"
    android:text="@string/scores_GameNumber" android:textSize="12sp"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_marginRight="13sp"/>
  <TextView
    android:id="@+id/tvwPlayer0Name" android:layout_weight="1" android:gravity="right"
    android:textSize="12sp" 
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_marginRight="13sp"/>
  <TextView
    android:id="@+id/tvwPlayer1Name" android:layout_weight="1" android:gravity="right"
     android:textSize="12sp"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_marginRight="13sp"/>
  <TextView     
    android:id="@+id/tvwPlayer2Name" android:layout_weight="1" android:gravity="right"
     android:textSize="12sp"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_marginRight="13sp"/>
  <TextView     
    android:id="@+id/tvwPlayer3Name" android:layout_weight="1" android:gravity="right"
    android:textSize="12sp"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_marginRight="13sp"/>
</LinearLayout>


  <ListView
   android:id="@+id/lvwScores" android:layout_below="@id/lloPlayerNames"
   android:layout_width="fill_parent" android:layout_height="wrap_content"  
   android:divider="#FFFFFF" android:dividerHeight="1dip" 
   android:layout_weight="1"
   android:footerDividersEnabled="true" android:headerDividersEnabled ="true"/>

<Button android:id="@+id/btnOK" 
  android:layout_height="wrap_content" android:layout_width="120dip" 
  android:layout_weight="1"
  android:text="OK" android:layout_centerHorizontal="true" 
android:layout_alignParentBottom="true" 

   />
</RelativeLayout>

Problem is that when the list gets to be too big it just passes the button and the button sits over the top of the list.

I tried to add android:layout_below=”@id/lvwScores” to the button but then, when the list is empty, I get a button that runs from the bottom of the screen to the bottom of the list.

If I remove the android:layout_alignParentBottom=”true” then the dialog is made small.

At the end of the day, I am looking to have the list filling most of the screen even if part of it is still empty (it is a scores screen), with the button at the bottom.

Any ideas?

This is what it looks like when empty:
enter image description here

It is great, except that when the list builds up and reaches the bottom is down not stop at the button.

  • 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-23T05:16:00+00:00Added an answer on May 23, 2026 at 5:16 am

    Can you maybe give the list view or the list view’s container a margin at the bottom that is the height of the button? Just as a test, give the button a height of 30 dips and have the listview or listview’s container have a bottom margin of 30 dips to see if it still runs over behind the button.

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

Sidebar

Related Questions

I have a Form with a listview. After calling Form.Show I need to update
I have an activity with ListView that has: android:theme=@android:style/Theme.Dialog in Manifest. When I open
I have a small custom dialog in wich I have a ListView with id:list.
I have a dialog with a listView and OK button, id text radiobutton1 radiobutton2
I have a simple list view with some check boxes in an alert dialog.
I have a ListView which sometimes I need to put around 10000 items in.
I have a ListView containing file names. These file names need to be draggable
I have a ListView on a page that displays a list of widgets. When
After reading some posts like this one: Choose File Dialog It appears that Android
I have a listview that displays a list of profiles added by a user.

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.