0

I wanted to create a cool layout background, so I created an image which will serve as layout instead.

My image is of 320X480 resolution which will serve ideal for mdpi resolution mobiles but what about bigger screen size handset.

My Question: Should I create several images(here my layout) of different sizes for different size handset OR there is a code which will just resize the image when opened in different size handset.

Mohit
  • 1,045
  • 4
  • 18
  • 45
  • 2
    A layout is a combination of views and view containers. An image cannot be a layout, but it can be the background of a layout. If you want to support clean graphics on different resolutions you have to make different images. – ElDuderino Feb 22 '14 at 13:18

1 Answers1

1

To create a image for different densities, you should follow the 2:3:4:6:8 scaling ratio between the five primary densities (medium, high, x-high, xx-high, and xxx-high respectively). For example, consider that the size for a launcher icon is specified to be 48x48 dp. This means the baseline (MDPI) asset is 48x48 px, and the high density (HDPI) asset should be 1.5x the baseline at 72x72 px, and the x-high density (XHDPI) asset should be 2x the baseline at 96x96 px, and so on.

You should refer official website of android for that for more information: Link 1

  • I get that but can you tell me, if I can just use a 9-patch image for background and it will be resized automatically for diff screens. – Mohit Feb 22 '14 at 20:56
  • you must ask new question for another query not related to this question @Mohit –  Feb 25 '14 at 07:24