Design images for Android screens

被刻印的时光 ゝ 提交于 2019-12-11 06:39:36

问题


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


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/8737469/design-images-for-android-screens

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!