Unable to make LWUIT Textarea to grow by content
I am using LWUIT for the Series 40 below.
[url]http://projects.developer.nokia.com/LWUIT_for_Series_40[/url]
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.
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.
Re: Unable to make LWUIT Textarea to grow by content
Excellent! Thanks for looking into the issue.
Re: Unable to make LWUIT Textarea to grow by content
[QUOTE=ChinLoong;902841]Excellent! Thanks for looking into the issue.[/QUOTE]
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.
Re: Unable to make LWUIT Textarea to grow by content
Yes, this is a very useful workaround. Thanks!
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=im2amit;902865]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.[/QUOTE]
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=im2amit;902865]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.[/QUOTE]
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.
Re: Unable to make LWUIT Textarea to grow by content
[url]http://stackoverflow.com/questions/14339671/how-to-make-textarea-lost-focus-using-code-in-lwuit-for-s40[/url]
thanks ,another question,How to make TextArea lost focus using code in LWUIT for S40
Re: Unable to make LWUIT Textarea to grow by content
[QUOTE=phxzuo;909378][url]http://stackoverflow.com/questions/14339671/how-to-make-textarea-lost-focus-using-code-in-lwuit-for-s40[/url]
thanks ,another question,How to make TextArea lost focus using code in LWUIT for S40[/QUOTE]
Use setFocus() to move the focus to some other component on the screen or move to another form by calling its show().
Re: Unable to make LWUIT Textarea to grow by content
it seems first method doesn't work. second not suitable for the scene。