Rachel Bernouli
Rachel Bernouli

Reputation: 225

Removing useless space from TextView after breakline

I'm expriencing problems with TextViews...

Its seems like depending on the size of the next word before it breaks to new line, on its own, the string has no '\n' in it, t leaves useless blank space that I don't want.

This is the problmetic Textview:

and other times it goes like I want it to:

What is causing this? help :)

Upvotes: 0

Views: 292

Answers (1)

Neel Mehta
Neel Mehta

Reputation: 106

It seems like this is a text justification problem. In Android O, Android introduced the android:justificationMode attribute.

If you are targeting Android O+, adding android:justificationMode="inter_word" should justify the text so that this doesn't occur. If you are targeting older versions of Android, you might be able to use some libraries (here) to achieve this behavior.

Upvotes: 2

Related Questions