Hi,
I have an age old question.
How do I make my buttons, rows, fonts etc same [physical] size across say an iPhone4, iPhone5 and an iPad?
Using ZoomStretch or LetterScale in config.lua is not the answer as these simply help scale visuals in one way or another. What I need is to know the exact capabilities of a device my app is running on so that I can adjust the size of objects on the fly…
For example, lets say the tableview widget I’m using displays n rows on an iPhone 4. Lets say this offers the best row height and font size etc for the particular purpose at hand. Now if you run the same app on an iPhone 5 with zoomStretch you will still be showing n rows with each row and fonts being taller. If you run the app on an iPad row height as you would measure with a real ruler will be about twice if not more. The app now looks like a joke on a tablet.
So what I need is a way to detect exact screen size, not in Corona size units so I can display n count of rows in that space on an iPhone 4, say n + 2 rows on an iPhone 5 and say n x 2 on an iPad… I can do all that thanks to the flexibility of the widget api but I need to programmatically know what I’m working with…
I came across an excellent post by bob.dickinson on the Code Exchange where he articulates the challenge very clearly and then proceeds to share his approach to solving the problem. It can be found here : http://developer.coronalabs.com/code/device-metrics-scaling-based-screen-size …
This was shared more than a year ago and as a Corona SDK newbie I can’t help but wonder if any new developments have occurred since that time. Has Corona Labs addressed this need in any way?
I would appreciate any responses, thoughts or suggestions you might have. Thank you very much!
Regards,
Kerem