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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:56:31+00:00 2026-05-16T15:56:31+00:00

I have four buttons arranged in a 2×2 TableLayout. These buttons each have an

  • 0

I have four buttons arranged in a 2×2 TableLayout. These buttons each have an image on the left and some text. The buttons display fine in the emulator for 1.5, and for 2.2, but when testing with 1.6 the two buttons in the righthand column are cropped so that they are missing their righthand edge (the padding to the right of the text is missing and the button ends abruptly with squared off corners rather than rounded ones). There is plenty of room for the TableLayout to expand to accommodate the full width of the buttons. This happens for all screen sizes.

The layout looks like this and itself appears within a RelativeLayout:

<TableLayout android:id="@+id/buttons"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_centerHorizontal="true"
             android:layout_alignParentTop="true"
             android:paddingTop="10dp">
  <TableRow>
    <Button android:id="@+id/button1"
            style="@style/LaunchButton"
            android:drawableLeft="@drawable/button1"
            android:text="@string/button1"/>
    <Button android:id="@+id/button2"
            style="@style/LaunchButton"
            android:drawableLeft="@drawable/button2"
            android:text="@string/button2"/>
  </TableRow>
  <TableRow>
    <Button android:id="@+id/button3"
            style="@style/LaunchButton"
            android:drawableLeft="@drawable/button3"
            android:text="@string/button3"/>
    <Button android:id="@+id/button4"
            style="@style/LaunchButton"
            android:drawableLeft="@drawable/button4"
            android:text="@string/button4"/>
  </TableRow>
</TableLayout>

The buttons are styled as follows:

<style name="LaunchButton">
  <item name="android:layout_width">wrap_content</item>
  <item name="android:layout_height">wrap_content</item>
  <item name="android:gravity">fill_horizontal</item>
  <item name="android:textSize">24dp</item>
  <item name="android:textStyle">bold</item>
</style>

I’m assuming this is a 1.6-specific bug. Has anybody else come across this problem? Any suggestions for work-arounds?

EDIT: I’ve had the opportunity to try it with Android 2.1 (both on the emulator and a device), and the problem happens there too. So 1.5 good, 1.6 bad, 2.1 bad, 2.2 good.

  • 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-16T15:56:32+00:00Added an answer on May 16, 2026 at 3:56 pm

    I also ran into the same problem on 1.6 and 2.1 but not on 1.5 nor 2.2.

    I use LineraLayout and set its weight instead and skip the problem using TableLayout.

    <LinearLayout
        android:orientation="horizontal" android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <LinearLayout android:layout_width="fill_parent"
            android:layout_weight="1" android:layout_height="wrap_content"
            android:gravity="center">
            <ImageButton
                android:layout_width="wrap_content" android:layout_height="wrap_content" />
        </LinearLayout>
        <LinearLayout android:layout_width="fill_parent"
            android:layout_weight="1" android:layout_height="wrap_content"
            android:gravity="center">
            <ImageButton
                android:layout_width="wrap_content" android:layout_height="wrap_content" />
        </LinearLayout>
        <LinearLayout android:layout_width="fill_parent"
            android:layout_weight="1" android:layout_height="wrap_content"
            android:gravity="center">
            <ImageButton
                android:layout_width="wrap_content" android:layout_height="wrap_content" />
        </LinearLayout>
    

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

Sidebar

Related Questions

I have some databases that have four files each; one for PRIMARY, IDX, IMAGE,
I have four buttons on top of a bar (background image) . What I'm
So, I have a DIV full of four HTML buttons that use an image
I currently have a view with four buttons, and would like to be able
I have four columns and four buttons I got them to all line up
I am writing a Java application, and I have four radio buttons, call them
I have four buttons, which have to push the same uiTableViewController, with different data
I have map application in which I have four buttons for Zoom In, Zoom
I am new in iphone...i have created toolbar with Four buttons...code is show below...I
I have four tables containing exactly the same columns, and want to create a

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.