I have a TextView with both width and height set to wrap_content and max_lines set to 2. When text fits in one line, everything works perfectly. But when it wraps to the second line, TextView's width becomes as big as possible (it fills parent container).
So, what I want:
|Some Long| |Text |And what I get:
|Some Long | |Text |
Try setting the max width of the TextView. I think when you set the width wrap_content and it moves on to the next line it means the width is at its maximum (so it fills parent containter). So I guess when you set the max width it has to go to the next line once it reaches this width.
android:maxWidth="140dp"
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