How to set a line spacing in a text of a TextView

Viewed 7331
txt.setText("abc \n defgh");

I want to have line spacing to be some value. Sample range 5 dp.

abc
'5dp range'
defgh
3 Answers

**You can use "lineSpacingExtra". It will works, happy coding **

<TextView
    android:layout_width="match_parent"
    android:layout_height="180dp"
    android:lineSpacingExtra="10dp"/>
Related