iOS中tab bar图标、APP 图标等各种图标的尺寸标准

来自 Apple 的官方文档

Every app needs an app icon and a launch file or image. In addition, some apps need custom icons to represent app-specific content, functions, or modes in navigation bars, toolbars, and tab bars.

Unlike other custom artwork in your app, the icons and images listed in Table 41-1 must meet specific criteria so that iOS can display them properly. In addition, some icon and image files have naming requirements (to learn about naming these files, see App Icons and App Launch (Default) Images).

Table 41-1Size (in pixels) of custom icons and images

Asset

iPhone 6 Plus (@3x)

iPhone 6 and iPhone 5 (@2x)

iPhone 4s (@2x)

iPad and iPad mini (@2x)

iPad 2 and iPad mini (@1x)

App icon (required for all apps)

180 x 180

120 x 120

120 x 120

152 x 152

76 x 76

App icon for the App Store (required for all apps)

1024 x 1024

1024 x 1024

1024 x 1024

1024 x 1024

1024 x 1024

Launch file or image (required for all apps)

Use a launch file (see Launch Images)

For iPhone 6, use a launch file (see Launch Images)

For iPhone 5, 640 x 1136

640 x 960

1536 x 2048 (portrait)

2048 x 1536 (landscape)

768 x 1024 (portrait)

1024 x 768 (landscape)

Spotlight search results icon (recommended)

120 x 120

80 x 80

80 x 80

80 x 80

40 x 40

Settings icon (recommended)

87 x 87

58 x 58

58 x 58

58 x 58

29 x 29

Toolbar and navigation bar icon (optional)

About 66 x 66

About 44 x 44

About 44 x 44

About 44 x 44

About 22 x 22

Tab bar icon (optional)

About 75 x 75 (maximum: 144 x 96)

About 50 x 50 (maximum: 96 x 64)

About 50 x 50 (maximum: 96 x 64)

About 50 x 50 (maximum: 96 x 64)

About 25 x 25 (maximum: 48 x 32)

Default Newsstand cover icon for the App Store (required for Newsstand apps)

At least 1024 pixels on the longest edge

At least 1024 pixels on the longest edge

At least 1024 pixels on the longest edge

At least 1024 pixels on the longest edge

At least 512 pixels on the longest edge

Web clip icon (recommended for web apps and websites)

180 x 180

120 x 120

120 x 120

152 x 152

76 x 76

For all images and icons, the PNG format is recommended. You should avoid using interlaced PNGs.

The standard bit depth for icons and images is 24 bits—that is, 8 bits each for red, green, and blue—plus an 8-bit alpha channel.

You don’t need to constrain your palette to web-safe colors.

IOS界面元素的尺寸以及屏幕尺寸

fourPhones

How to detect the current device size and kind

Element iPhone 4S (and earlier) iPhone 5 iPhone 6 iPhone 6 Plus
Window (including status bar area) 320 x 480 pts 320 x 568 pts 375 x 667 pts 414 x 736 pts
iOS8 Portrait Keyboard (English)
with QuickType
320 x 253 pts 320 x 253 pts 375 x 258 pts 414 x 271 pts
iOS8 Portrait Keyboard (English)
without QuickType
320 x 224 pts 320 x 224 pts 375 x 225 pts 414 x 236 pts
iOS8 Landscape Keyboard (English)
with QuickType
480 x 193 pts 568 x 193 pts 667 x 194 pts 736 x 194 pts
iOS8 Landscape Keyboard (English)
without QuickType
480 x 170 pts 568 x 170 pts 667 x 171 pts 736 x 171 pts
Launch Image Sizes 640 x 960 pixels 640 x 1136 pixels 750 x 1334 (@2x) portrait
1334 x 750 (@2x) landscape
1242 x 2208 (@3x) portrait
2208 x 1242 (@3x) landscape
This page is available as an interactive version in the idev101 app!

Other dimensions common to all screen sizes:

Status Bar
(How to hide the status bar)
20 pts
Navigation Bar 44 pts
Nav Bar/Toolbar Icon white icon – up to 20 x 20 pts (transparent PNG)
Tab Bar 49 pts
Tab Bar Icon up to 30 x 30 pts (transparent PNGs)
Text Field 31 pts

Points vs. Pixels

Apple introduced retina displays starting with the iPhone 4. You don’t have to modify your code to support high-res displays; the iOS coordinate system uses points rather than pixels, so the dimensions and position in points of all UI elements remains the same across all devices.

iOS supports high resolution displays via the scale property on UIScreen, UIView, UIImage, and CALayer classes. If you load an image from a file whose name includes the @2x modifier, its scale property is set to 2.0. Similarly an image with a @3x modifier has a scale of 3.0. Otherwise the scale defaults to 1.0.

Retina Graphics

To support high-resolution graphics on devices with retina displays, create two versions of the image: a standard size image, and a double-sized image with “@2x” added to the name:

Standard Size: High Resolution:
homeSmall
button.png
60 x 20
homeBig
button@2x.png
120 x 40

To refer to an image in your code (or in Interface Builder), use the filename of the standard sized image. iOS will automatically detect and use the @2x version if the device supports it:

Xcode中屏蔽某个源文件的全部编译警告信息

某些时候如果我们的源码在编译过程中出现大量的编译警告时,看起来是挺不爽的;但又确实没办法解决警告问题的时候,我们可以使用下面的方法来屏蔽指定的某个文件的所有警告信息。

1、在Xcode中选中工程文件。

2、在右边面板中选中“Build Phases”。

3、展开“Compile Sources”。

4、在需要屏蔽警告的源文件一行中双击“Compiler F lags”。

5、在弹出窗口中输入-w

1366815659_7884

Xcode 5 Xcode 6 解决 The operation couldn’t be completed. (NSURLErrorDomain error -1012.) 问题

使用Xcode的SVN 出现问题

The operation couldn’t be completed. (NSURLErrorDomain error -1012.)

解决方法:

打开终端 然后输入如下命令

svn ls xxxx  (xxx是你SVN Server的地址)

这里询问你是否允许这个地址的访问,我们输入 “ p ”,即永久接受证书,然后回车即可。

再次控制台输入  svn ls xxxx 如果显示文件列表就成功了。

这时候再回到xcode正常操作即可。

令人纠结的IE MIME-TYPE

最近在做iOS下面的HTTPSERVER,遇到了奇怪问题,在FF和SAFARI以及chrome上都访问正常的页面,在IE9下面却乱七八糟,好像丢失了CSS。通过IE9的调试功能,发现“SEC7113: CSS 因 Mime 类型不匹配而被忽略 ”错误提示,查阅资料,才知是IE9的安全设置问题。我的HTTPSERVER必须返回Content-Type 为 text/css才能被IE9接受。

CSS问题解决了,新问题来了,对于PNG文件,输出MIME-TYPE为 image/png 和 image/x-png,IE下都有一部分显示不正常。而在输出image/png时,其他浏览器都能正常显示。查阅了很多资料也没有解决,只好暂时放弃!

  • fafsdsadsadsadas