facebook

New Lines

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #345560 Reply

    jedmgrew
    Member

    New to Java, searched Interweb, any ideas welcome. If I have a text area, inside a scrolling panel, how do I set the text to autofit to the text area? Ive tried using the \n,\r etc with no effect. I’ve also changed the autofit options as much as I can with no effect. Here’s the code…..(The text is obviously a lot longer than the example.)

    $(‘#m1-test2-text2’).text(‘Mind reading is \n useful in some cases’);

    Do I need the \n?
    Thanks

    #345561

    KariSolamaki
    Member
    #345565

    Unknown Author
    Participant

    In the text area itself, try initially filling it with spaces that auto-wrap. Then, any text you put there will also auto-wrap.
    -1tc

    #345600

    support-michael
    Keymaster

    @jedmgrew

    Can you clarify by “text area” are you referring to a TextArea widget or a Text widget?

    If you are dynamically replacing the content of a Text widget with longer text than you used in the designer then @1thinchip suggestion works. Reserve extra space for future content that is longer than the initial text by padding out the Text widget with the largets amount of text you anticipate.

    Note, the Text widget will not reduce its size to shrink wrap around smaller text.

    Lastly, the \n in your example code should work if you include extra vertical space in your Text widget (use shift-return to add newlines to a Text widget)

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: New Lines

You must be logged in to post in the forum log in