Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

More space between lines in TextView

I have a TextView with about 10 rows. I want to have the lines more separated from each other. I can't seem to find an attribute for doing that. I tried with: android:includeFontPadding="true" but the text got all weird like stretched or something. Is there any attribute that I don't know about to do that?

Thanks in advance.

like image 677
madcoderz Avatar asked May 17 '11 09:05

madcoderz


People also ask

How to add line spacing in TextView android?

Just we need to add an attribute with your TextView that give the spacing with lines. These are –android:lineSpacingExtra, android:lineSpacingMultiplier – use these two attributes with your TextView in XML file. or Programatically call setter method of that attribute textView. setLineSpacing().

How do I increase line spacing in android?

Adding android:lineSpacingMultiplier="0.8" can make the line spacing to 80%. Show activity on this post. You can use TextView. setLineSpacing(n,m) function.

How do you add multiple lines in TextView?

When you have a text that's longer than one line, then the TextView will automatically put the text in multiple lines. When you set the layout_width and layout_height as wrap_content or match_parent , then the TextView widget will use all the available space to display the text you specified as its content.


2 Answers

Use android:lineSpacingMultiplier="1.2" or some number greater than 1

like image 160
TofferJ Avatar answered Nov 13 '22 13:11

TofferJ


You can use android:lineSpacingExtra="xxdp"

like image 26
rochdev Avatar answered Nov 13 '22 14:11

rochdev