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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:16:14+00:00 2026-06-01T14:16:14+00:00

I have a linear layout with several buttons in it. The button images are

  • 0

I have a linear layout with several buttons in it. The button images are all the same size and have the same attributes… except for one button. This one button has a smaller font size. All the buttons except for this one are in a perfect line exactly the way I want. For some reason, the button with the smaller font appears a little lower on the screen than the other buttons. I’m having a hard time wrapping my head around the idea of a button that requires less space taking up additional space.

Might someone give me a hint on what to read up on?

EDIT

Here’s main.xml (seems like SO filters some of it, all the important stuff is here…)

<ScrollView android:id="@+id/scroll"
            android:layout_width="match_parent"
            android:layout_height="300px">

    <TextView
            android:id="@+id/the_text_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:typeface="monospace"
            android:textSize="9pt"
            android:background="@color/paper"
            android:paddingLeft="20dp"
            android:paddingBottom="20dp"
            android:textColor="@color/type"
            />
</ScrollView>

<LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    <Button style="@style/ASR33_button"
            android:tag="Y"
            android:text="Y"
            />

    <Button style="@style/ASR33_button"
            android:tag="N"
            android:text="N"
            />

    <Button style="@style/ASR33_button"
            android:tag="E"
            android:text="E"
            />

    <Button style="@style/ASR33_button"
            android:tag="W"
            android:text="W"
            />

    <Button style="@style/ASR33_button"
            android:tag="S"
            android:text="S"
            />

    <Button style="@style/ASR33_button"
            android:tag="F"
            android:text="F"
            />

    <Button style="@style/ASR33_button"
            android:tag="R"
            android:text="R"
            />

    <Button style="@style/ASR33_button"
            android:tag="M"
            android:text="M"
            />

    <Button style="@style/ASR33_button"
            android:tag="T"
            android:text="T"
            />

    <Button style="@style/ASR33_button"
            android:onClick="onEnterButtonClicked"
            android:textSize="6pt"
            android:text="RE-\nTURN"
            />

    <Button style="@style/ASR33_button"
            android:tag="U"
            android:text="U"
            />
</LinearLayout>

<LinearLayout
        android:orientation="horizontal"
        android:layout_marginTop="10dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    <TextView
            android:id="@+id/instructions"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:textSize="9pt"
            android:paddingLeft="10dp"
            android:typeface="normal"
            android:text="Commands: (Y)es, (N)o, (N)orth, (E)ast, (W)est, (S)outh, (M)ap, (ST)atus, (Fight), (R)un, (SU)icide.  All commands must be followed by RETURN."
            />

</LinearLayout>

The one that’s wonky is the 2nd from the bottom, with the different onclick event. The style has 11pt for the character size. If I use it (and a 1 letter button name, like the others) it behaves. But that’s not what the ASR33 ‘enter’ key has on it. So if I reduce the font size to say 6 pt, the weirdness happens.

The style can be seen here.

Again, just reading references or ideas please, I can figure it out if I have a word or two to search on. It’s hard to know what you don’t know…

RESOLUTION

Anurag has it right, see his answer below. Here’s an excerpt of the updated LinearLayout:

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:baselineAligned="false">
  • 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-01T14:16:15+00:00Added an answer on June 1, 2026 at 2:16 pm

    maybe the re sizing has happened due to the wrap_content property of your button. so what you should do is have a fixed height to the linear layout holding all the buttons while its with is set to fill parents.

    and inside the linear layout let individual buttons have height set to wrap content which will give all the buttons the same height as that of the linear layout and also set the attribute android:adjustViewBounds="true" for the small button. this attribute will resize your image button to maintain the aspect ratio. i hope this helps.

    EDIT:
    So here is the solution to your problem, something that was caused due to the base alignment property of the linear layout. A horizontal LinearLayout aligns the baselines of all its child controls by default. So the first line of text in your multi-line button is vertically aligned with the single line of text in the other buttons. set android:baselineAligned=”false” on the LinearLayout. This worked perfectly on my HTC.

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

Sidebar

Related Questions

I have a linear layout with this form <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical
I have a linear layout which consists of imageview and textview , one below
I have following three button in a Linear Layout with width fill_parent . How
I have a Linear layout with vertical orientation in which I'm inserting several view
I have a Gallery whose Adapter creates several LinearLayout instances. Those linear layout instances
I have a clickable linear layout that I've generated programmaticly, and I want it
I have this layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent android:background=#222222 android:gravity=center_horizontal android:layout_gravity=center_horizontal android:paddingBottom=5dp> <SeekBar
I would like to have radio buttons in one radiogroup divided into 2 columns
I have an Linear Layout inside the View Flipper. When i fling/swipe the layout
In one of my androids activities, I have several widget in a vertical linearlayout.

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.