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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:14:55+00:00 2026-05-28T04:14:55+00:00

I have a problem with centering text on buttons in a layout that I

  • 0

I have a problem with centering text on buttons in a layout that I am working on. Please see the screenshot below (taken within eclipse’s “Graphical Layout” tab):

Button Text Problem

I’m not sure what’s causing this. I tried playing around with the individual layout properties of the buttons, but this has not had any effect. The following is my layout hierarchy:

LinearLayout (orientation is "vertical")
    ...
    RelativeLayout
        Button ("MM/DD/YYYY")
        Button ("HH:MM")
        TextView ("to")
        Button ("MM/DD/YYYY")
        Button ("HH:MM")
    ...
    LinearLayout (orientation is "horizontal")
        Button ("Close"; layout_weight is "1")
        Button ("Reserve Room"; layout_weight is "1")

XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="1024dp"
    android:layout_height="640dp"
    android:orientation="vertical"
    android:padding="10dp" >
    ...
    <RelativeLayout
        android:id="@+id/dateTimePickersLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <Button
            android:id="@+id/startingDateButton"
            android:layout_width="244dp"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:text="@string/mm_dd_yyyy" />

        <Button
            android:id="@+id/endingTimeButton"
            android:layout_width="244dp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:text="@string/hh_mm" />

        <Button
            android:id="@+id/endingDateButton"
            android:layout_width="244dp"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_toLeftOf="@+id/endingTimeButton"
            android:text="@string/mm_dd_yyyy" />

        <Button
            android:id="@+id/startingTimeButton"
            android:layout_width="244dp"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_toRightOf="@+id/startingDateButton"
            android:text="@string/hh_mm" />

        <TextView
            android:id="@+id/toTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerInParent="true"
            android:text="@string/to"
            android:textSize="18dp" />
    </RelativeLayout>
    ...
    <LinearLayout
        android:id="@+id/LinearLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/closeButton"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/close" />

        <Button
            android:id="@+id/reserveRoomButton"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/reserve_room" />
    </LinearLayout>
</LinearLayout>

Anyone have any ideas what may be causing this?

Thank you for your help!

  • 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-28T04:14:56+00:00Added an answer on May 28, 2026 at 4:14 am

    I ended up updating eclipse and that fixed the problem. I was extremely disappointed that restarting the IDE did not change anything, especially since the XML had not posed any problems for others. Thanks for the help, everyone!

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

Sidebar

Related Questions

I have a TextView that has text Dynamically Added to it. My problem is
I have problem in some JavaScript that I am writing where the Switch statement
I have problem when I try insert some data to Informix TEXT column via
I have problem with fancybox. I want to write a function that will run
First I have a pretty casual problem, vertically centering an image inside a list.
I'm having a problem with an image and some text. I have this code:
I have created a custom TaskButton control that takes an image and text. The
I have a jquery game that you can view here link text The game
I have a jquery game that you can view here link text The game
I have a page with more than one form. One form (see below example)

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.