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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:06:56+00:00 2026-05-26T21:06:56+00:00

How can I make a Layout with Buttons in matrix like: Button Button Button

  • 0

How can I make a Layout with Buttons in matrix like:

Button Button

Button Button

I want to have access to these Buttons by the loop (for example, for()), because I want to change the text of these Buttons dynamically.

I tried to make a TableLayout and TableRow, but nothing works.

  • 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-26T21:06:56+00:00Added an answer on May 26, 2026 at 9:06 pm

    You can use TableLayout.

    Check here for explanation:

    http://developer.android.com/resources/tutorials/views/hello-tablelayout.html

    Here an example:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout 
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
        android:orientation="vertical" 
        android:layout_height="fill_parent" 
        android:layout_width="match_parent"
        android:id="@+id/mainLayout">
    
    <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tableLayout1">
        <TableRow 
            android:id="@+id/tableRow2" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent">
            <Button
                 android:layout_height="wrap_content" 
                 android:id="@+id/button1" 
                 android:layout_width="wrap_content" 
                 android:text="@string/first_color">
            </Button>
            <Button 
                android:id="@+id/button2" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:text="@string/second_color">
            </Button>
            <Button 
                android:id="@+id/button3" 
                android:layout_width="wrap_content" 
                android:text="@string/third_color" 
                android:layout_height="wrap_content">
            </Button>
        </TableRow>
        <TableRow 
            android:id="@+id/tableRow3" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
            <Button 
                android:id="@+id/button5" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:text="@string/tolerance">
            </Button>
        </TableRow>
    </TableLayout>
    </LinearLayou>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a navigation menu with 4 buttons using a grid layout.
Ok, i have two buttons in linear layout: <LinearLayout android:id=@+id/linearLayout1 android:layout_height=wrap_content android:layout_width=fill_parent> <Button android:id=@+id/aktiviraj_paket
If we make fluid layout we can use em or % for font and
I can make a DAO recordset in VB6/Access do anything - add data, clean
Can someone tell me how I can make the following output? I have a
I want to make a layout similar to this one: www.ImageBanana.net - layout.png http://www.imagebanana.com/img/9kmlhy66/thumb/layout.png
how can I make a button place side by side. I used a gridBagLayout
I have a main layout in which I'd like to sequentially display / hide
I am trying to make a really easy xml layout and I can't seem
I would like to make a layout using Java Swing which looks like 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.