Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android TextView default line spacing

There is a methods that multiply spacing between lines in TextView

  • lineSpacingMultiplier

I want to multiply it by 2 , but what is the default spacing value that it multiplies? 2px, 5px?

Thanks.

like image 614
Alexander Gorelik Avatar asked Mar 19 '15 08:03

Alexander Gorelik


People also ask

What is default line spacing in android?

android:lineSpacingMultiplier governs the spacing between lines with a default of "1".

How do I set line spacing in 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().

What is line height in TextView?

Line height usually means text size + "padding" top/bottom. So, if your designer write line height 19sp and text size 15sp, it means you need to have extra padding 4sp. 19sp - 15sp = 4sp. To implement it in your layout, use lineSpacingExtra attribute.

What is TextAppearance in android?

TextAppearance allows you to define text-specific styling while leaving a View 's style available for other uses. Note, however, that if you define any text attributes directly on the View or in a style, those values would override the TextAppearance values.


Video Answer


1 Answers

The value is a 17.1 percent of the text size.

But use 20 percent to be sure that letter like j or g appear correctly

like image 69
Daniel Jose Padilla Peña Avatar answered Oct 13 '22 00:10

Daniel Jose Padilla Peña