A TextView displays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing.
In this blog you will know how to increase the spacing between two lines of TextView.
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().
Example-
- android:lineSpacingExtra
1 2 3 4 5 6 7 8 9 10 11 |
<TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="blog 1 link\blog 2 linko\nblog 3 link\nLineSpacingExtra = 10dp" android:background="#eaa3a3" android:textSize="18dp" android:layout_margin="10dp" android:padding="10dp" android:lineSpacingExtra="10dp" /> |
- android:lineSpacingMultiplier
1 2 3 4 5 6 7 8 9 10 11 |
<TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="blog 1 link\blog 2 linko\nblog 3 link\nLineSpacingExtra = 10dp" android:background="#eaa3a3" android:textSize="18dp" android:layout_margin="10dp" android:padding="10dp" android:lineSpacingMultiplier="1.2" /> |
That set for giving line spacing between lines of TextView.