简体   繁体   English

使用点数与像素为iOS应用程序创建图标和图像

[英]Creating icons and images for an iOS application with points vs pixels

I have an icon area that I used an UIImageView to display it. 我有一个使用UIImageView进行显示的图标区域。 If the imageview has the following frame: 如果imageview具有以下框架:

CGRectMake(0, 0, 20, 20)

How big (in pixels) do I make my icon for all the different iPhone display types? 我可以为所有不同的iPhone显示类型制作多大的像素(以像素为单位)? I know I need x.png, 2x.png and 3x.png and want them to look good in iPhone 5, 6 and 6 plus. 我知道我需要x.png,2x.png和3x.png并希望它们在iPhone 5、6和6 plus中看起来不错。

iOS uses points instead of pixels. iOS使用点而不是像素。 So, when you create a 20x20(points) image, it is actually 20x20 pixels for regular iPhone screens where 1px = 1point. 因此,当您创建20x20(点)的图像时,对于1px = 1点的常规iPhone屏幕,实际上是20x20像素。 For @2x, it is like 40x40 pixels and for @3x it is like 60x60 pixels. 对于@ 2x,它就像40x40像素,对于@ 3x,它就像60x60像素。 This sizes should be sufficient to make them look good basically, as far as I know. 据我所知,这个尺寸应该足以使它们基本看起来不错。

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

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