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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:33:22+00:00 2026-05-19T22:33:22+00:00

My project was working fine, when suddenly the text on my buttons was being

  • 0

My project was working fine, when suddenly the text on my buttons was being displayed vertically. By which I mean instead of map_infobutton displaying

Info

it was displaying

I
n

with the f and o beyond the bounds of the button, even though I have specified height=wrap_content in the TableLayout containing the buttons.

It appears fine in the Layout tab in eclipse, and only appears vertical in the emulator (not tried on target hardware)

getPaddingLeft for one of the buttons returns 11 at various points in the code. Not sure where it gets that from, but the spacing looks bigger than that anyway. I did have three buttons and took one away, but the problem existed with both two and three buttons.

My layout is:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <TextView
    android:id="@+id/map_header"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:paddingTop="8px"
    android:paddingBottom="8px"
    android:gravity="center"
    android:textColor="@color/header_foreground"
    android:background="@color/header_background"
    android:text="@string/map_header"/>
  <TableLayout
    android:id="@+id/map_footer"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:paddingTop="4px"
    android:paddingLeft="2px"
    android:paddingRight="2px"
    android:stretchColumns="*"
    android:textColor="@color/footer_foreground"
    android:background="@color/footer_background">
    <TableRow>
      <Button
        android:id="@+id/map_infobutton"
        android:layout_width="0px"
        android:layout_weight="1"
        android:text="@string/map_infobutton" />
      <Button
        android:id="@+id/map_selectbutton"
        android:layout_width="0px"
        android:layout_weight="1"
    android:text="@string/map_selectbutton" />
</TableRow> 
  </TableLayout>
  <LinearLayout
    android:id="@+id/map_selectiondetails"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_above="@id/map_footer"
    android:orientation="horizontal"
    android:gravity="center"
    android:textColor="@color/main_foreground"
    android:background="@color/main_background" >
    <TextView
        android:id="@+id/map_selectionname"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingRight="4px"
        android:textColor="@color/main_foreground"
        android:background="@color/main_background"/>
    <TextView
        android:id="@+id/map_selectiondistance"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="4px"
        android:paddingRight="4px"
        android:textColor="@color/main_foreground"
        android:background="@color/main_background"/>
    <TextView
        android:id="@+id/map_selectionvar1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="4px"
        android:paddingRight="4px"
        android:textColor="@color/main_foreground"
        android:background="@color/main_background"/>
    <TextView
        android:id="@+id/map_selectionvar2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="4px"
        android:paddingRight="4px"
        android:textColor="@color/main_foreground"
        android:background="@color/main_background"/>
    <TextView
        android:id="@+id/map_selectionvar3"
    android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="4px"
        android:textColor="@color/main_foreground"
        android:background="@color/main_background"/>
      </LinearLayout>
      <SurfaceView
        android:id="@+id/map_map"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_above="@id/map_selectiondetails"
        android:layout_below="@id/map_header"
        android:clickable="true"/>

    </RelativeLayout>

Any ideas? Also if you have any comments on how I’m creating the layout, as I’m new to this and it seems like there are a lot of options available, but I’m trying to make it as simple as possible.

  • 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-19T22:33:23+00:00Added an answer on May 19, 2026 at 10:33 pm

    I had a similar problem.

    I see that you have multiple buttons that you want to have the same width, so you specify the button’s width as “0px” and the weight as “1”. This is exactly what I did.

    When I set the button text within the XML file, things look fine. However, I have one button that changes is text depending on whether a process is running or not. In my case, it is similar to the situation where a button toggles from “Start…” to “Stop…” After the text changes, it prints vertically and only the top one or two letters of each button are shown.

    After reading your post, it occurred to me that, perhaps, the text was being set before the button width had been determined, and then not updated once the button width changes according to the “weight”.

    I modified it such that in each button, it now reads:

    android:layout_width="fill_parent" instead of “0px”

    In theory, this should have the same effect. However, in practice, the button width is adjusted before the text is updated. The behaviour is now correct.

    Rob

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

Sidebar

Related Questions

The project has been working fine in 2003 but when opening it in 2008
Client side Validation and ValidationSummary is working fine for my project (MVC4 + Razor
I'm using Visual Basic 6 for a legacy project and it's been working fine.
I have web application Project having RPC call. one RPC async is working fine.
Am using kaminari ajax pagination in my project. It is working fine, But contents
I have used push notification for my project & was working fine with HTTP
I've got a Visual Studio 2010 C++ project. Previously everything was working fine but
I am working on a MVC project and the performance was fine. On application_start
I am using Flash Builder 4.6 Yesterday the project is working fine. Now it
My project was working fine couple of minutes ago,all of a sudden i run

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.