celtic tree program - how do i get the textbox to wordwrap?

225 views
Skip to first unread message

Tyler Jacobs

unread,
Sep 28, 2015, 6:12:56 AM9/28/15
to MIT App Inventor Forum
hello this is my first time using this app inventor 2 I was wondering how I could get the text box to fix the text inside the parameters and not run off the page. I also have several paragraphs for each page i want to. Also what i would think would be in the properties section isnt there, so im not sure what i need to do in order to get the text to display inside of the phone screen parameters as well as what is in the text box (thinking maybe a scrolling section, user just scrolls down the page to finish reading the rest of the text.) how do i do all this? thanks tyler

SteveJG

unread,
Sep 28, 2015, 8:36:38 AM9/28/15
to mitappinv...@googlegroups.com
if you are using a Label for your text Tyler, place     a control character ( that looks like this  \n    )where you want the break.   For example       Now isthe time for all good men to come to the aid of their friends.
becomes

Now is the time
for all good men
to come to the aid 
of their friends.

If you type  Now is the time\n for all good men\n to come to the aid\n of their friends.  you get the above formatting in a label.   You may also have to use the Horizontal Layout or Vertical Layout controls and experiment with  Automatic versus FillParent sizing.

You may also have to set the Screen1 to Scrollable.    You can do that in blocks or by ticking the box on the Designer screen, screen1 Properties.

If you are actually using a TextBox object (and not a Text block) you can tick the box Multi-line  and use the same technique.



Part of this tutorial explains that for large blocks of text as one of the two methods it describes  https://appinventorforfun.wordpress.com/2014/09/29/treasure-island-the-app-an-e-reader-tutorial/  and it might help you.

You are new and we want you to have fun with App Inventor so here are some resources to help you learn to use the AI2 tools  A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.

There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  

How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .


Regards,
Steve

Reply all
Reply to author
Forward
0 new messages