ios 设置导航栏图标的大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23211345/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:59:41  来源:igfitidea点击:

setting the size of navigationbar icon ios

iosuinavigationbarrightbarbuttonitem

提问by user2823044

I want to know is there any default size for Navigationbar icons.where designer need to design it.Should they design it for retina and non-retina display.At present I'm using images downloaded from internet which are not looking great.

我想知道导航栏图标是否有任何默认大小。设计师需要设计它。他们是否应该为视网膜和非视网膜显示设计它。目前我正在使用从互联网下载的图像,这些图像看起来不太好。

回答by User 1531343

Create navigation bar icon in the following sizes:

创建以下尺寸的导航栏图标:

About 44 x 44 pixels

About 22 x 22 pixels (standard resolution)

more informtation you can find here https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/BarIcons.html

您可以在此处找到更多信息 https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/BarIcons.html

回答by Suragch

The recommend sizes in the docsfor the navigation bar icons are as follows:

文档中导航栏图标的推荐尺寸如下:

@1: 25 x 25
@2: 50 x 50
@3: 75 x 75

Create three images of the above pixel sizes and then add them to a new image set in your Assets.xcassets file.

创建三个上述像素大小的图像,然后将它们添加到 Assets.xcassets 文件中的新图像集中。

enter image description here

在此处输入图片说明

Notes

笔记

  • When I try to make the icons at the recommended sizes, they look too small to me. I actually make them a little bigger than that. So take the doc recommendations as a starting point, but you might have to make adjustments as necessary.
  • A second method would be to use a single universal vector image (pdf) (see hereand here). Not everyone recommends this, but it is the method I use now. It's convenient and makes future image editing and resizing easier.
  • 当我尝试以推荐的尺寸制作图标时,它们对我来说看起来太小了。我实际上让它们比那大一点。因此,以文档建议为起点,但您可能必须根据需要进行调整。
  • 第二种方法是使用单个通用矢量图像 (pdf)(参见此处此处)。不是每个人都推荐这个,但这是我现在使用的方法。它很方便,使未来的图像编辑和调整大小更容易。

回答by Ramdhas

 1. iPhone 5     88 / 64  px
 2. iPhone 4/4S  88 / 64 px 
 3. Retina iPad  88 px
 4. iPad Mini    44 px
 5. iPad         44 px

The Navigation Bar usually includes a title as well as basic navigation and action buttons (such as back to previous view, create, edit, etc.). In landscape orientation, the height of the Nav bar is usually shrunk a bit (to 32pt) to allow more content to be displayed below it.

导航栏通常包括标题以及基本导航和操作按钮(例如返回上一个视图、创建、编辑等)。在横向模式下,导航栏的高度通常会缩小一点(至 32 磅),以允许在其下方显示更多内容。

Ref Link: http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/

参考链接:http: //ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/

回答by NKB

Check Apple's documentation for icon and image sizes here. For more detailed UI icon specification check here.

在此处查看 Apple 的文档以了解图标和图像大小。有关更详细的 UI 图标规范,请查看此处