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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:02:10+00:00 2026-05-23T23:02:10+00:00

I have a custom listview which changes size when one of the rows is

  • 0

I have a custom listview which changes size when one of the rows is clicked, new rows are added. When the activity first loads there is only one row and two buttons(previous & next) in a tablelayout.
Currently if i have my listview in added to a tablerow & row 2 contains the buttons. The layout height & width are set to wrap_content.

When new rows are added to the listview, the row size does not change and secondly expands to occupy the space that was for buttons. And therefore as a result my buttons disappear.

main.xml

<LinearLayout android:orientation="vertical" style="?fill_parent"
android:layout_weight="1">
<TableLayout style="?fill_parent" android:layout_weight="1" >
<TableRow android:id="@+id/tr1">
   <CustomList android:id="@+id/mainview" ndroid:layout_height="wrap_content"
   android:layout_width="wrap_content" />
</TableRow>
<TableRow android:layout_height="wrap_content" android:layout_width="match_parent">
   <Button android:layout_width="wrap_content" android:id="@+id/button1"
    android:text="@string/buttonPrevious" android:layout_height="wrap_content">         </Button>
  <Button android:layout_width="wrap_content" android:id="@+id/button2"
  android:text="@string/buttonNext" android:layout_height="wrap_content"></Button>
</TableRow>
</TableLayout>
</LinearLayout>

How do I dynamically update the row size when the new rows are being added to the views.?
Thanks

  • 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-23T23:02:11+00:00Added an answer on May 23, 2026 at 11:02 pm

    Replace TableLayout with a RelativeLayout:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" 
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
      <CustomList android:layout_above="@+id/btn_pnl" 
        android:id="@+id/mainview" 
        android:layout_height="fill_parent"
        android:layout_width="fill_parent" />
          <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/btn_pnl"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:layout_alignParentBottom="true">
            <Button android:layout_width="wrap_content" 
              android:id="@+id/button1"
              android:text="@string/buttonPrevious" 
              android:layout_height="wrap_content">
            </Button>
            <Button android:layout_width="wrap_content" 
              android:id="@+id/button2"
              android:text="@string/buttonNext" 
              android:layout_height="wrap_content"></Button>
        </LinearLayout>
    </RelativeLayout>
    

    This layout will put your buttons at the bottom of the screen, while the ListView will cover the whole screen.

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

Sidebar

Related Questions

I have a custom listview in which one textview and one checked box is
I have one custom ListView which contains one ImageView and one TextView, and I
Basically, I have a custom ListView in which each item looks like: <LinearLayout> <Table>
I have a custom ListView that uses a custom ArrayAdapter (which basically just overrides
I have a listview which loads its data from sqlite database. Each row in
I have a custom ListView activity that maintains a state array (3 choices, default=black,
I have a custom ListView adapter which implements an ImageThreadLoader class. Unfortunately, the class
I have a custom ListView adapter which implements an ImageThreadLoader class. Unfortunately the class
I have made a custom listView which which extends ListActivity and each row contains
I have a listview in which i wanted to have custom typeface e.g. Arial.

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.