Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Text wrapping in Android SDK?

I need a bit of help with Android SDK. I'm following along with the tutorial and I'm unable to get the text to wrap to the second line. It's supposed to say, "Ants stretch when they wake up in the morning."

There are a million different text properties on the right panel, and I figure the solution to this is somewhere in that list of attributes, but I am unable to find it. =\

Image for reference: http://imgur.com/a/fIdeZ

1 Answer

Seth Kroger
Seth Kroger
56,413 Points

You have both layout_width and layout_height set to wrap_content which grows or shrinks the the "widget" to fit the content. To get the text to wrap, you need to fix the width. In this case you want layout_width to be match_parent.