×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    25

    Unable to make LWUIT Textarea to grow by content

    I am using LWUIT for the Series 40 below.

    http://projects.developer.nokia.com/LWUIT_for_Series_40

    Below is my code for using the LWUIT textarea.

    //Set textarea row to 1, and column to 10
    title = new TextArea("The quick brown fox jumps over the lazy dog",1,10);
    title.setSingleLineTextArea(false);
    title.setGrowByContent(true);
    title.setEditable(false);

    The textarea does not grow, even though my string requires more than 1 line to be displayed completely.

    However, if I pass 2(for row argument) into the textarea constructor, the textarea will grow to show the string completely.
    My problem with setting row to 2 is if the string is only 1 line, the textarea will still display an additional empty line, which I want to avoid.

    May I know, how I can solve this issue? Thanks in advance.

  2. #2
    Nokia Developer Expert
    Join Date
    May 2012
    Location
    Espoo
    Posts
    224

    Re: Unable to make LWUIT Textarea to grow by content

    Hi ChinLoong,

    s40 version of LWUIT has this problem. I reported to RnD team. Thanks for bringing this issue up.

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    25

    Re: Unable to make LWUIT Textarea to grow by content

    Excellent! Thanks for looking into the issue.

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Unable to make LWUIT Textarea to grow by content

    Quote Originally Posted by ChinLoong View Post
    Excellent! Thanks for looking into the issue.
    Till the time this Issue is fixed (automated), as a workaround you can try to calculate the length of String which you want to render in the textArea by using charsWidth(char[]) with the used Font and based on this define the no. of rows.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Jul 2012
    Posts
    25

    Re: Unable to make LWUIT Textarea to grow by content

    Yes, this is a very useful workaround. Thanks!

  6. #6
    Registered User
    Join Date
    Jan 2013
    Posts
    9

    Re: Unable to make LWUIT Textarea to grow by content

    the issue exsit in 0.83,Can anyone check it out. thanks very much

    Quote Originally Posted by im2amit View Post
    Till the time this Issue is fixed (automated), as a workaround you can try to calculate the length of String which you want to render in the textArea by using charsWidth(char[]) with the used Font and based on this define the no. of rows.

  7. #7
    Registered User
    Join Date
    Jan 2013
    Posts
    9

    Re: Unable to make LWUIT Textarea to grow by content

    it's useful on static case, but when it's dynamic , I have no good solution
    Quote Originally Posted by im2amit View Post
    Till the time this Issue is fixed (automated), as a workaround you can try to calculate the length of String which you want to render in the textArea by using charsWidth(char[]) with the used Font and based on this define the no. of rows.

  8. #8
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Unable to make LWUIT Textarea to grow by content

    For Dynamic you do these calculation and runtime and repaint after changing the TextArea size.... as text grows.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  9. #9
    Registered User
    Join Date
    Jan 2013
    Posts
    9

    Re: Unable to make LWUIT Textarea to grow by content

    http://stackoverflow.com/questions/1...-lwuit-for-s40

    thanks ,another question,How to make TextArea lost focus using code in LWUIT for S40

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Unable to make LWUIT Textarea to grow by content

    Quote Originally Posted by phxzuo View Post
    http://stackoverflow.com/questions/1...-lwuit-for-s40

    thanks ,another question,How to make TextArea lost focus using code in LWUIT for S40
    Use setFocus() to move the focus to some other component on the screen or move to another form by calling its show().
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  11. #11
    Registered User
    Join Date
    Jan 2013
    Posts
    9

    Re: Unable to make LWUIT Textarea to grow by content

    it seems first method doesn't work. second not suitable for the scene。

Similar Threads

  1. LWUIT TextArea Problem
    By zzwei in forum Mobile Java General
    Replies: 4
    Last Post: 2012-09-20, 10:12
  2. How to reduce the Font of a text from LWUIT TextArea
    By pavanragi in forum Mobile Java General
    Replies: 7
    Last Post: 2012-08-17, 10:06
  3. [moved] LWUIT Textarea with multilines
    By kenthan in forum Mobile Java General
    Replies: 2
    Last Post: 2012-06-21, 11:00
  4. Replies: 3
    Last Post: 2011-07-19, 07:50
  5. How to make widget grow outside of its parent widget
    By supermanfg in forum [Archived] Qt SDKs and Tools
    Replies: 3
    Last Post: 2010-01-09, 11:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •