Home > Tricks & Tips > Set line-break in TextView

Set line-break in TextView

A simple trick to set line-break (new-line character insertion) in TextView:


Now just insert new-line character to have a line-break in your view.

textView.setText("First line \nSecond line \nThird line");

Have fun!

Pete Houston

  1. sai Susheel
    December 20, 2017 at 10:56 pm

    I didn’t get your answer!!!!

  2. SUMAN
    June 19, 2015 at 6:38 pm

    Hi.. How to add new line in textview while fetching data from webservice(SOAP)?

  3. roy jalbout
    June 5, 2013 at 5:44 pm

    Great website
    PLease I need ur help am a newbie
    Where to put this line
    textView.setText(“hello \nhow are you \nfine”);

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: