vnshetty
vnshetty

Reputation: 20132

how to solve this image scaling problem in android?

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

Upvotes: 2

Views: 595

Answers (2)

Paresh Mayani
Paresh Mayani

Reputation: 128428

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/

Upvotes: 1

Farray
Farray

Reputation: 8528

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?

Upvotes: 1

Related Questions