IOS 8 asset catalog image sizes confusing

半世苍凉 提交于 2020-01-03 04:54:07

问题


Say I want to make a button that takes up half the width of the iPhone screen (portrait) at @1x. This would be 160 pixels, @2x this would be 320 pixels.

Now with iPhone 6 and iPhone 6 plus it gets confusing. The iPhone 6 has 750 pixels width and uses @2x but the asset catalog has only one box for adding @2x images, so do I make my image 320 pixels or 375 pixels?

Also, the iPhone 6 Plus has width of 1080 pixels or 1242 pixels (any idea which one?), but my standard image of 160 pixels multiplied by 3 = 480 pixels but half the iPhone 6 Plus screen is either 540 pixels or 621 pixels??

What size I should be making my images and why?


回答1:


The iPhone 6 and 6 Plus have the same aspect ration as the iPhone 5/5C/5S, so they automatically scale the image for your screen. For the iPhone 6, your image should be 320 pixels, just like with a 4-inch screen.

For the 6 Plus, you should make it 480 pixels for the same reason.



来源:https://stackoverflow.com/questions/26187585/ios-8-asset-catalog-image-sizes-confusing

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