Supporting multiple screen sizes with Android using ImageButtons

Posted by droidy on Stack Overflow See other posts from Stack Overflow or by droidy
Published on 2010-04-13T19:48:31Z Indexed on 2010/04/13 19:53 UTC
Read the original article Hit count: 522

Filed under:
|

I've read the Android documentation: http://developer.android.com/guide/practices/screens_support.html but still have some questions.

I'm trying to design a music application which basically has images of the instrument (ImageButton) that play a sound when clicked. However, I'm confused about how to have the ImageButtons scale to fit all the different screen sizes and how to position them.

  1. Which layout is best used for needing to position ImageButtons in specific locations on the screen? (i.e. cymbals on a drum set) FrameLayout, RelativeLayout?

  2. If I only really care about medium and large screens, do I need to create different resources (images) for both as well as a different XML layout to position them?

I'm trying to find the simplest way to do this without having to create a separate layout XML file for positioning/size and separate image resources for each screen.

Any guidance is greatly appreciated. Thanks!

© Stack Overflow or respective owner

Related posts about android

Related posts about android-sdk