I would like to set android:lineSpacingMultiplier=0.7
and have android:maxLines=3
for TextView. It works when text is not longer than 3 lines, but when text is longer than 3 lines it cuts part of last line (see image on imgshack: IMAGE)
Same thing happens when using in code textView.setLineSpacing(0, 0.7f)
.
Tried to extend TextView height and make font smaller, both ideas failed - still cuts last line.
Any thoughs?
This appears to be a bug in the text view class in Android. Unfortunately all that is available are only workarounds, as far as I know.
There is a workaround where you measure dynamically how much lines your text will need in the text view and set the 'maxLines' dynamically.
There is another workaround where you 'mislead' the view 'telling' it it is has a bit more height (override onMeasure)
See TextView last line drawn in half
None of these are ideal unfortunately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With