Search code examples
androidimageandroid-layoutscale

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


Solution

  • 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/