Chayy
Chayy

Reputation: 834

TextView : lineSpacingMultiplier and lineSpacingExtra applies to the last line too

Ok, so everything is in the title : if we change the spacing between lines of a TextView with lineSpacingMultiplier or lineSpacingExtra, the last line of the TextView adds the extra too.

So the result is that we have spacing in the bottom of the view, as if we had a bottom padding. The text doesn't appear to be centered in the view, so the design of the layout is not sexy.

Is this really the correct behavior or a bug ? and is there any way to remove this spacing for the last line ?

Upvotes: 5

Views: 2822

Answers (2)

adi
adi

Reputation: 1130

In my case,I was using

android:inputType="textMultiLine|textNoSuggestions"

in my textview irrespective of the font used.

Removing this removed the linespacing from the last line of the textview

Upvotes: 0

Chayy
Chayy

Reputation: 834

In fact, I was using custom fonts that were making this behavior. So it's not a platform bug, or anything like that.

Upvotes: 4

Related Questions