I am a UX architect working with a team of Android developers that are mostly junior. We are having issues properly setting line height in Android.
We are using the
I'll explain this from Android Developer perspective.
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.
Another way to achieve line height is using scale. For example, 1.2. It means, the spacing is 120% of the text size.
In example above, the line height is 19sp and the text size is 15sp. If we translate it into scale, it become.
19/15 = 1.26
To implement it in your layout, use the lineSpacingMultiplier attribute.