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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:29:58+00:00 2026-05-27T23:29:58+00:00

I am developing some sort of player with 2×3 grid of custom buttons… Buttons

  • 0

I am developing some sort of player with 2×3 grid of custom buttons… Buttons are made in customplayerbutton.xml and then they are used as “includes” in main.xml There is a problem with layout – my custom buttons do not fit the TableRow:

bad layout http://img841.imageshack.us/img841/6492/badlayout.png

What am I doing wrong?

customplayerbutton.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:drawable/btn_default"
    android:clickable="true"
    android:focusable="true"
    android:longClickable="true"
    android:orientation="vertical">

    <TextView
        android:id="@+id/textView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="2.0"
        android:gravity="center"
        android:text="Track67890"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="2.0"
        android:gravity="center"
        android:text="99:99:999 / 99:99:999"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <ProgressBar
        android:id="@+id/progressBar1"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.1" />

</LinearLayout>

main.xml:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/TableLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:longClickable="true"
    android:stretchColumns="*" >

    <TableRow
            android:id="@+id/TableRow01"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1.0" >

            <include
                    android:id="@+id/include01"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_gravity="left"
                    layout="@layout/customplayerbutton" />

            <include
                    android:id="@+id/include1"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_gravity="right"
                    layout="@layout/customplayerbutton" />
    </TableRow>

    <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1.0" >

            <include
                    android:id="@+id/include02"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    layout="@layout/customplayerbutton" />

            <include
                    android:id="@+id/include04"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    layout="@layout/customplayerbutton" />
    </TableRow>

    <TableRow
            android:id="@+id/TableRow02"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1.0" >

            <include
                    android:id="@+id/include03"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    layout="@layout/customplayerbutton" />

            <include
                    android:id="@+id/include05"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    layout="@layout/customplayerbutton" />
    </TableRow>

</TableLayout>
  • 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-27T23:29:59+00:00Added an answer on May 27, 2026 at 11:29 pm

    Finally, I solved this by replacing TableLayout to LinearLayout. Here is the xml worked to me:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1.0" >
    
                <include
                        android:id="@+id/include01"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_weight="1.0"
                        layout="@layout/customplayerbutton" />
    
                <include
                        android:id="@+id/include00"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_weight="1.0"
                        layout="@layout/customplayerbutton" />
        </LinearLayout>
    
        <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1.0" >
    
                <include
                        android:id="@+id/include02"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_weight="1.0"
                        layout="@layout/customplayerbutton" />
    
                <include
                        android:id="@+id/include04"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_weight="1.0"
                        layout="@layout/customplayerbutton" />
        </LinearLayout>
    
        <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1.0" >
    
                <include
                        android:id="@+id/include03"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_weight="1.0"
                        layout="@layout/customplayerbutton" />
    
                <include
                        android:id="@+id/include05"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_weight="1.0"
                        layout="@layout/customplayerbutton" />
        </LinearLayout>
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing with Google Maps v3. For some sort of reason, my custom marker icon
I'm developing some sort of air mouse application for iPhone platform. This applications connects
I'm developing android app. It's some sort of social network. Where user can add
I am developing a website that has some sort of realtime update. Now the
I'm developing a web app that needs some sort of filesystem access. Ideally I'd
I am currently developing a Silverlight 3 app that needs some sort of user
I am developing voice application. I need a buffer queue of some sort so
I am developing some sort of service using asp.net mvc 4 web api. On
Hy, I am developing some sort of monitoring system with GPS coordinates through KML
We are developing some sort of intercom system. We need to play real time

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.