简体   繁体   English

设计Android屏幕的图像

[英]Design images for Android screens

I'm designing splash images for an Android app. 我正在为Android应用程序设计启动图像。 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 我知道,图像大小应该具有3:4:6:8的比例,以适合每个屏幕dpi的要求,因此我设计了如下的初始图像(在Photoshop CS 5中设计):

low (ldpi) - 184px X 58px 低(ldpi)-184px X 58px
medium (mdpi) - 246px X 78px 中(mdpi)-246px X 78px
high (hdpi) - 369px X 117px 高(hdpi)-369px X 117px
x-high (xhdpi) - 492px X 156px x高(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. 但问题是,屏幕尺寸较小,例如具有高分辨率或中分辨率的240 x 320(例如:索尼爱立信Xperia Mini Pro),并且当应用选择适合该分辨率的图像时,该图像对于屏幕尺寸而言太大。

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 就我而言,将为Xperia Mini及其369px X 117px选择hdpi图像,但实际屏幕尺寸为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. Android文档对我来说很乱。

Help !!!!! 救命 !!!!!

Thank you in advance! 先感谢您!

Note: 9-Patch Samples 注意:9补丁样本

在此处输入图片说明

Just make sure you mention fill_parent for height and width attribute. 只要确保您提及height_width属性的fill_parent即可。 That would be just fine. 那就好了。

Reg the image designing the best way is to create a 9 patch image. 设计映像的最佳方法是创建一个9色块映像。 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. 这将与屏幕的宽度和高度匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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