iOS导航栏项目图片大小

时间:2014-03-24 11:07:57

标签: ios navigationbar

我想自定义NavigationBar按钮并使用我自己的图片。

问题是尺寸应该是多少?

我发现按钮尺寸应为40 * 40,因此视网膜的图像应为80 * 80?

6 个答案:

答案 0 :(得分:86)

这些是documentation现在为自定义图标推荐的尺寸。

enter image description here

  • @ 2:50 x 50
  • @ 3:75 x 75

创建上述像素大小的两个图像,然后将它们添加到Assets.xcassets文件中的新图像集。 (显然不再需要@ 1尺寸。)

enter image description here

或者,您可以使用通用矢量图像(pdf)(请参阅herehere)。这是我最近的偏好。

相关回答

答案 1 :(得分:18)

Apple更新了他们的Human Interface Guidelines Docs。现在为导航栏工具栏

创建自定义图标的建议尺寸
  • @ 2x - rails generate devise User (24pt×24pt @ 2x)

  • @ 3x - 48px × 48px(24pt×24pt @ 3x)

enter image description here

答案 2 :(得分:12)

典型标准尺寸(非Retina)为22px×22px,而2x(或Retina)尺寸为44px×44px。

答案 3 :(得分:5)

Apple文档已更新,现在推荐的大小为25pt x 25pt。

请参阅文档here

答案 4 :(得分:1)

以下是当前尺寸:

https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/

“工具栏和导航栏 - 介于24x24(@ 1x)和28x28(@ 1x)之间”。

答案 5 :(得分:1)

您应为每个标签栏项目(1x,2x和3x)准备3个图像图标。

首先以75w 75h像素(最大值:144 x 96)创建3x并将其保存为iconTab0@3x.png。

然后将其调整为50w 50h像素(最大值:96 x 64)并保存为iconTab0@2x.png。

最后将其调整为25w 25h像素(最大值:48 x 32)并将其保存为iconTab0.png。

现在您只需要在取景器中选择这3张图像并将它们拖到图像资源中。

人机界面指南

enter image description here

enter image description here

enter image description here