Share via

Strange Wrapping Patterns

Nathan Sokalski 4,111 Reputation points
2022-04-04T19:44:45.687+00:00

I have a TextView that is doing strange wrapping & not displaying all text. Here is the code & screenshots for 2 of the scenarios:

android:text="Remove Visits Before"  

189884-screenshot-1649099702.png

android:text="Remove Visits Before Visits Before1 2 Before3 4 Before5 6 Before7 8 Before9 10 Before11 12 Before13 14 Before x y z Something 1 2 3 4 5 6 7 8"  

189828-screenshot-1649099500.png

Notice that in the first scenario, the last word is not displayed or wrapped, yet the second scenario does wrap, but still does not display all the text. Both the TextView & the parent (the orange rectangle, which is a LinearLayout) have wrap_content for both layout_width & layout_height. Why is a simple TextView doing such strange (and different) things when displaying basic text?

Developer technologies | .NET | Xamarin

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.