简体   繁体   中英

Design images for Android screens

I'm designing splash images for an Android app. But when it comes to different screen sizes and resolutions, i'm stuck at the root.

I have understood that there should be a 3:4:6:8 ratio in image sizes to fit each screen dpi requirements, so I have designed (designed in Photoshop CS 5) a splash image as below

low (ldpi) - 184px X 58px
medium (mdpi) - 246px X 78px
high (hdpi) - 369px X 117px
x-high (xhdpi) - 492px X 156px

But the issue is, there are small screen sizes such as 240 x 320 with high or medium resolutions (example: Sony Ericsson Xperia Mini Pro) and when the app selects the image appropriate for this resolution, the image is too large for the screen size.

In my case, the hdpi image will be selected for the Xperia Mini and its 369px X 117px but the actual screen size is 240px X 320px

Is there something i'm missing in this? or should I do something differently when designing. Android documentation is gibberish to me.

Help !!!!!

Thank you in advance!

Note: 9-Patch Samples

在此处输入图片说明

Just make sure you mention fill_parent for height and width attribute. That would be just fine.

Reg the image designing the best way is to create a 9 patch image. If you create different image for diff sets of device. It is a over head always. Check this and this

Simply you can use the Image view to set the screen content.

ImageView iv=ImageView(this);
iv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
......
 ......
......
setcontentView(iv);

This will match for the screen width and height.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM