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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:01:48+00:00 2026-06-18T20:01:48+00:00

This is easily the weirdest problem I’ve ever faced. So today, I created a

  • 0

This is easily the weirdest problem I’ve ever faced.

So today, I created a new Android Project. The first layout xml had just a textview that has the following properties (its inside a relative layout):

<TextView
    android:id="@+id/textView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="124dp"
    android:background="#80ffffff"
    android:gravity="center_vertical"
    android:text="Welcome"
    android:textSize="48dp"
    android:textStyle="bold" />

What I wanted was to have a textview that has text in its center. But the text STARTS from the center and goes out of screen towers the right side.

So I thought I must be doing something wrong. I went into one of my older projects (it was also open in eclipse). I opened an XML there, and shockingly, all the text there has also moved to the left (It starts from the center, rather than actually centering the text). It was fine yesterday. Here’s the button:

<Button
    android:id="@+id/gettingstarted"
    android:layout_width="210dp"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/login"
    android:layout_below="@+id/login"
    android:layout_marginTop="10dp"
    android:text="Getting Started"
    android:textColor="#ffffff" />

I have no idea what happened. Why is the text no longer centered in buttons in all my projects? I’m in a really tough spot right now. Kindly 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-06-18T20:01:49+00:00Added an answer on June 18, 2026 at 8:01 pm

    For your first problem try

    android:gravity="center_vertical|center"
    

    but for your text views in your all projects , it’s a general question , maybe it’s occured because of changing in your apps theme or projects styles

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

Sidebar

Related Questions

I have written something like this pretty easily in C# ( string GetUrl(new {
Sorry for the title... This would easily win the weirdest thingy of the week.
I can do this easily using a TextBoxFor but how do I do it
I think this is easily explained by looking at code, so I'm posting a
I know that this can be easily done by using if(i%5 == 0 OR
I generally work with dataframes and could easily do this for a data frame
Thought my range of search options would easily find this. I wish to combine
I would like to execute code sequentially in an NSOperation. This can be easily
I easily get Week Number using MySql Week function like this WEEK(SYSDATE()) I just
This question (along with its answer) explains why you can't easily bind a DataGridView

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.