Here are a few ideas:

1. Create a background that has the maximum possible aspect ratio: it's 16:9 (1.777) for 480 by 854, and less than that for 480 by 800 (1.66), 1024 by 600 (1.7) and 320 by 480 (1.5).

Push the background to the top when drawing, so that the bottom part is clipped on devices with smaller aspect ratio (320 by 480.

Place the buttons at a fixed position, specified in "dp" units (device independent).

This should cover phones, as well as tablets.

2. Scale the background or use a nine-patch.

Implement your own subclass of ViewGroup that can position the buttons, calculating their positions based on screen resolution and aspect ratio.

As a further enhancement, create several background at several common aspect ratios (I'd pick 1.7 and 1.5).

-- Kostya

03.12.2010 15:05, Serdel пишет:
Thank you all for your response. I am now reading about supporting
multiple screens in android :
http://developer.android.com/guide/practices/screens_support.html

My problem is that the buttons must be preciously placed to correspond
properly with the background (that's why the accurate, exact dip
values like 291). I can support multiple layout but how much of them I
am inf act able to present - giving different layouts for each device
is quite pointless (and the main problem is in the layout not the size
of images).



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to