2

How to design a layout that should support all screen size. See the Images below..
How can i make all screen looks properly with same images?

Edit:here larger screen [WXGA] displays in proper way. becoz i used image button there to change alphabets(Eg A,B,....)

enter image description here enter image description here

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
vnshetty
  • 20,051
  • 23
  • 64
  • 102

2 Answers2

1

Unfortunately it's not as simple as scaling the images larger. That will produce very poor results on larger screen formats.

The proper way to support multiple screens is to include different resources for different size categories. At the very least you should create separate layout files for small and large screens and include different drawables for the screen densities you want to support.

There's a lot of information at http://developer.android.com/guide/practices/screens_support.html Maybe give that a read and then post additional questions if you have them?

Farray
  • 8,290
  • 3
  • 33
  • 37
1

Yes I am totally agree with Farray's answer. You should create separate layout files and put inside the particular folder like layout-land, layout-large-land, layout-large, etc. and create different drawables for the different densities and put those drawables inside the suitable folder like drawable, drawable-hdpi, drawable-ldpi, drawable-mdpi, etc.

For example:

enter image description here

Update:

As you want to put buttons for all the alphabets, in that case you should use GridView and define your custom adapter with ImageButton and set the same adapter inside the GridView, I am sure this will looks perfect as per your requirement. For your reference, I would like to suggest you to go through this: http://www.firstdroid.com/2011/02/06/android-tutorial-gridview-with-icon-and-text/

HoLyVieR
  • 10,985
  • 5
  • 42
  • 67
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
  • 1
    Plus you should specify the text size using "dp" instead of "px" or "pt". – Jonas Schmid Jul 11 '11 at 05:40
  • @PM - Paresh Mayani images are not fixed. u can see above.. they are image button i have 26 Images(A-z) for that button it should change at run time. i dont think it will be good idea of keeping 4 copies – vnshetty Jul 11 '11 at 05:41
  • 2
    Sorry Jonas, Its wrong, Whenever you want to specify font-size, then as per the Android you should mentioned it in "sp" , and other measurement should be in "dp" or "dip" for the height/width of any view like ImageView, TextView or any else. – Paresh Mayani Jul 11 '11 at 05:42
  • @vnshetty You have mentioned that you want to support multiple screen so replied according it, but you haven't mentioned properly what you want to do exactly? – Paresh Mayani Jul 11 '11 at 05:44
  • @PM - Paresh Mayani sorry for the incomplete question..question edited – vnshetty Jul 11 '11 at 05:45
  • @PM - Paresh Mayani pls answer this question http://stackoverflow.com/questions/6648047/how-to-categorize-android-layout-in-to-small-medium-large-screen – vnshetty Jul 12 '11 at 06:53