You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com
I'd like to define the look and size of a button by an image or more images for different DPI and set its text by localization. I tried it with image-border, component-background and button-icon, with and without multi-images but nothing really worked for all DPI. So whatis the correct wayto createa buttonfrom images with fixedsizes?
Shai Almog
unread,
Feb 19, 2014, 12:53:08 PM2/19/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com, ben.nus...@spherix.ch
What isn't working for all DPI's with multi-image's and icons? Multi-images are specifically designed for all DPI's.
ben.nus...@spherix.ch
unread,
Feb 19, 2014, 1:21:48 PM2/19/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com, ben.nus...@spherix.ch
The button for iPhones should be exactly 640x88px. I tried to use multi-images for the 9 image-borders with top and bottom images of 34px height (for the 480x854px high density DPI). The result was a bit too high. 1. was this the right approach or how can you build buttons with a fixed height? 2. is there a possibility to differentiate between iPhone4 and iPhone5 resolution within the multi-image?
thanks for your help
Shai Almog
unread,
Feb 20, 2014, 2:26:21 AM2/20/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to codenameone...@googlegroups.com, ben.nus...@spherix.ch
An exact size in pixels is a problematic proposition. I was talking about a multi image icon which you can set to an exact size for a specific DPI.
Other than that an exact size in pixels would be a bad idea since font sizes change slightly you can control the exact size though by adding padding to increase size to the image border approach.
You can set the size explicitly using setPreferredSize() but that is generally a bad idea since it will break the UI for other device resolutions hence sabotaging our effort at cross platform.