Multip-Line in Table Cell

21 views
Skip to first unread message

Hùng Phạm

unread,
Sep 23, 2014, 4:22:10 AM9/23/14
to codenameone...@googlegroups.com
Dear Shai.
I would like to ask you a question. 
I want to make a table cell with multip-line. So i override cell component as a TextArea (createCell() function).
It can display with multip-line but I got a table column problem. Its size displays in that way i dont expect.
I saw that the size of column in 2 below cases similar with each other. One case I use "\n" to make new line and the other is my test.

Is there any way to make multip-line in table cell with preferred size ?
Thanks
1.PNG

Diamond

unread,
Sep 23, 2014, 6:45:51 AM9/23/14
to codenameone...@googlegroups.com
If number of line is not going to be more than 4, You can try using MultiButton component setTextLine1 to setTextLine4.

If more than four lines, create a non-scrollable container and set it to BoxLayout-Y, create a Label for each line and set it's text to whatever you want. Then add this labels to the container and add the container to the form you are working on. 

And remember to make the form Scrollable-Y

Shai Almog

unread,
Sep 23, 2014, 11:57:30 AM9/23/14
to
Hi,
set the rows and the columns of the text area to a larger number than the default so the layout will get the right dimensions from the start.
Reply all
Reply to author
Forward
0 new messages