I want to make sure a TextView will not have singl...
# android
z
I want to make sure a TextView will not have single word per line. That means that if a text is long and is dropped to a second or third line, i want to check that there is more than one word in that line. Then break the text a word before that top ensure that there is more the one word in the last line. How can i count words in each line of a TextView?
😶 3
k
I will burn in the hell for that proposal 🔥 Just replace last space ” ” in your text with non-breaking space. In that case you will always have at least 2 words in last line
feelsgood 1
z
Static layout looks like an overkill for my needs. As for the other solution, i feel like i would want the second to last
" "
for that to work no?