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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:21:48+00:00 2026-05-26T18:21:48+00:00

My button’s layout_width set to match_parent. In order to display multi lines on the

  • 0

My button’s layout_width set to match_parent.

In order to display multi lines on the button, I tried:

  • insert ‘\n’ into the text on button

  • set Singleline false set Maxlines to 2 or 3

  • convert html from Html.fromHtml

Nothing worked. ‘\n’ showed up as a small square on the button while showing single line of text.

Does anybody have any idea why this is happening and how I can fix this?

UPDATE: I just found out I was using custom button that has its own text drawing. That’s the reason. Sorry for the confusion. I just punished myself by banging my head.

  • 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-26T18:21:49+00:00Added an answer on May 26, 2026 at 6:21 pm

    If you’re trying to add a new line in a layout XML file:

    Use 
 (new line)

        android:text="Hi
Hello"
    

    If you’re trying to add a new line in code, just use ‘\n’, same as in any other text.

    If you can’t see the second line, it may be that your Button doesn’t have enough height. IE, in my case, the layout containing the button had a fixed height that just happened to make my button perfectly display one line of text.

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

Sidebar

Related Questions

My button sends a parameter to the function. <Button android:id=@+id/tela1 android:layout_width=fill_parent android:layout_height=wrap_content android:text=Chinese Day
Button <asp:Button ID=btnAdd runat=server Text=Add/> Label <asp:Label ID=label1 runat=server></asp:Label> Set button visible when the
My button is: <Button android:text= android:id=@+id/b1 android:gravity=center_horizontal android:layout_width=100dp android:layout_height=100dp android:background=@drawable/the_border android:textSize=75sp/> And I have
The button doesn't show in this layout(code below),image and textview are shown. I tried
My button is set to size as needed (wrap_content); it does have a caption,
My button won't display. Does anyone know why? #import ViewController.h @implementation ViewController - (void)viewDidLoad
button has a Command binding into ViewModel (it runs some Save method in ViewModel).
The button below always expands to be as wide as the TextBlock. I've tried
Button bn = new Button(); bn.Location = new System.Drawing.Point(560, 350); bn.Name = btnDelete; bn.Text
Button class: class SubmitButton extends JButton implements ActionListener { public SubmitButton(String title){ super(title); ....

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.