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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:01:03+00:00 2026-06-02T05:01:03+00:00

I have a table layout in which i have declared a button statically in

  • 0

I have a table layout in which i have declared a button statically in the XML file. I add rows dynamically in the program. I want the button to be set at the very end of the table layout.
I tried doing that using android:layout_gravity=”bottom” but that is not helping.

Any solutions ?

This is my XML

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:scrollbars="horizontal|vertical"
android:scrollbarStyle="outsideInset" >
<TableLayout 
    android:id="@+id/table"
android:layout_width="match_parent"
android:layout_height="wrap_content">
    <Button 
        android:id="@+id/back"
        android:layout_gravity="bottom"
    />
</TableLayout>
</ScrollView>
  • 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-02T05:01:06+00:00Added an answer on June 2, 2026 at 5:01 am

    I don’t know exactly it will work for you but what you can do is to remove your button by using remove and then add it at run time after adding all your elements.

    Example:

        TableLayout tv = (TableLayout ) findViewbyId(R.id.table_layout_id);
        Button button = (Button) findviewbytid(R.id.button_id);
    

    May be you need layout param of your button so you can get it easily.

        LayoutParams lp = button.getLayoutParams();
    

    remove your button from layout.

        tv.removeView(button);
    

    ADD ALL YOUR VIEW AT RUNTIME.

    Add your button again.

         tv.addView(button, lp);
    

    I havnt tried this code but I think it should work. In some of the cases you don’t need layout params so you can ignore it too.

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

Sidebar

Related Questions

I have table, which is described in main xml layout. I need to know,
New to android programming. I have a layout XML, to which I want to
So I have a table layout that Im adding rows to through code since
I have a jquery scorlling table which is populated dynamically. I am using Bob
I want to create a table layout with custom table rows. Those rows should
I have a table layout that I want to populate with the result from
I have a webpage with a table layout in it which is develop using
I have a table layout with the following code <table cellspacing=0 class=photogalleryTable> <tbody> <tr>
I have this table layout: uuid bigint(20) unsigned primary auto_increment timestamp int(11) unsigned name
i am creating a new android application.i am using the table layout. I have

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.