Table layout - horizontal lines

62 views
Skip to first unread message

Ilana Loubser

unread,
Dec 11, 2014, 6:15:26 AM12/11/14
to codenameone...@googlegroups.com
Hi,

I have a table layout with 2 columns and a number of rows.  I would like to display horizontal lines between the labels - similar to the multi button display.  I've tried the approach followed by the SocialBoo app, where a label, with a horizontal line image as tiled background, is added between the rows.  This looks fine in the various emulators, but when running live on my iPhone 5S (iOS 8.0.2) - the lines are not shown.  On my HTC phone I do see the lines.

I then removed the dummy labels and tried to create a border for the text labels, using the same 1x2 pixel image.  This approach also looks fine in the emulators (see snapshot), but again, when running live, the horizontal border is missing.  Another problem is that the text in the 2nd row, that are supposed to be grey as defined by my theme, is black on the iPhone.

I've looked at the following blog post, but was not able to achieve this by setting the background and the margins.

https://groups.google.com/forum/#!searchin/codenameone-discussions/table$20layout$20line/codenameone-discussions/rFV0GIv8I1Y/2dk8YeJVxWIJ

Please help!

Thanks,
Ilana
tablelayout_lines_emulator.png
tablelayout_lines_iphone.png

Shai Almog

unread,
Dec 11, 2014, 9:47:24 AM12/11/14
to codenameone...@googlegroups.com
Hi,
that's not a link to a blog post.
Did you set the text of the label to " " instead of ""?
Did you make sure to give it some padding on all sides?

Ilana Loubser

unread,
Dec 12, 2014, 7:31:32 AM12/12/14
to codenameone...@googlegroups.com

Hi,

Thanks for the help.

The text of the label was set to one space.  I've now added padding (2 pixels) to all the sides of the 'line' labels, but are still experiencing the same problem.  I've also changed the image to a multi image.  Could the problem lie in the image itself (see attached)?  It is strange though that the emulator (I tried most of the skins), shows the line without a problem.

(sorry about the bad link, I was referring to the following post:  How to put lines between elements in the table layout)

Regards,
Ilana
grey_hor_line2.png

Shai Almog

unread,
Dec 12, 2014, 12:25:17 PM12/12/14
to codenameone...@googlegroups.com
Hi,
don't use such a small image. Use a larger image at least 300 pixels wide for better performance, I would recommend 2 pixel height for visibility. Small image tiling is really slow in terms of the GPU in the current code (mentioned here: www.codenameone.com/how-do-i---improve-application-performance-or-track-down-performance-issues.html ).
In this special case you don't really need multi images but if you do use it make sure the lower resolution output is still visible.

Ilana Loubser

unread,
Dec 17, 2014, 5:09:57 AM12/17/14
to codenameone...@googlegroups.com
Hi,

Thanks, I've changed the image to 300x2px.  I also changed it back to a normal image instead of a multi image.  Unfortunately I'm still not seeing the lines in the installed iOS version.  Is there something else I can try?

Shai Almog

unread,
Dec 17, 2014, 12:25:11 PM12/17/14
to codenameone...@googlegroups.com
Hi,
if you define the build argument ios.newPipeline=false does it workaround the issue?

Ilana Loubser

unread,
Dec 18, 2014, 8:02:48 AM12/18/14
to codenameone...@googlegroups.com
Hi,

No, but I did find the problem.  I created my own theme, but never removed the original theme.  I assume the two were conflicting with each other?  Both were set to:  base platform.

I guess what mislead me was the fact that it was displaying the 'correct' theme on the Android device.

Thanks for your help! :-)
Ilana
Reply all
Reply to author
Forward
0 new messages