Weekly discussion, code review, and feedback thread - October 10, 2022

Alright, I solved it.

I placed the TextView in a FrameLayout as I had done previously, but the key move was to add an arbitrary large (-2000px) margin to the left and right of the TextView. So in the xml, under the TextView, I added this code:

android:layout_marginLeft="-2000px"
android:layout_marginRight="-2000px

That did it. I assume you can do the same for the top and bottom if that were necessary. Now, with the TextView width android:layout_width set to wrap_content, the TextView will extend past the screen borders until it reaches the margins, instead of breaking the text line when it becomes longer than the screen width.

/r/androiddev Thread Parent