Hi, I've been working on an iphone app, and now looking at the android version, but as all the screens are different sizes, i'm stryggling getting views to go where they're supposed to.
For example, my header is 100% width, 30px high. When viewing on, for example, WVGA android emulator, it's really long and thin, as the 30 pixels should be different sizes. And it's a different amount needed on every android device.
I'm wondering if there is a way so scale a view based on one length? So if the width is 100%, the height would automatically be whatever is in proportion for that graphic.
Or is there generally a better way to lay out android apps so the height of the header changes depending on what android device it is?
2 Answers
You can try doing a method to update the sizes based on events that change the display
Try the Titanium.Platform.DisplayCaps.platformHeight and Titanium.Platform.DisplayCaps.platformWidth and using 1/4 of that number or any percentage.
In case anyone else is in the same situation. Adding the following to tiapp.xml seems to work perfectly! All android screens are then scaled based on the density of the screen.
<manifest> <supports-screens android:anyDensity="false"/> </manifest>
Your Answer
Think you can help? Login to answer this question!