简体   繁体   English

iPhone和iPad的iOS图像大小

[英]iOS image size for iPhone and iPad

I am developing universal app for iOS, 我正在为iOS开发通用应用程序,

I am using Autolayout feature in my app, 我在应用程序中使用了自动Autolayout功能,

I have one doubt: 我有一个疑问:

I want to apply background image in my app, How many background image i will have to make ?? 我想在我的应用程序中应用背景图片,我必须制作多少个背景图片? and what will be the naming conventions of the images ? 图像的命名约定是什么? so that iPhone automatically takes corresponding images according to device. 这样iPhone会根据设备自动拍摄相应的图像。

Like we gives on launch images, default@2x.png , Default-568h@2x.png , Default-Portrait@2x.png and device automatically understands it's corresponding images. 就像我们在启动图像上给出的default@2x.pngDefault-568h@2x.pngDefault-Portrait@2x.png default@2x.png Default-568h@2x.pngDefault-Portrait@2x.png ,设备会自动理解它的对应图像。

you need 2 types of images for iphone and ipad . 您需要iphoneipad两种图像类型。

For ipad you just need to add ~ipad before .png . 对于ipad你只需要添加~ipad.png
eg image.png for iphone and image~ipad.png for ipad . 例如, image.pngiphone image.pngimage~ipad.pngipad image~ipad.png

Do the same for Retina display images also. 对视网膜显示图像也执行相同的操作。

eg 例如

iPhone Retina : image@2x.png iPhone Retina :image@2x.png

iPad Retina : image@2x~ipad.png iPad Retina :image@2x~ipad.png

对于您的情况,应该有用的资产目录 ,这是迄今为止管理多个设备资产的最佳方法。

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

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