UIBarButtonItem图像应该有多大? [英] How big should a UIBarButtonItem image be?
问题描述
我正在寻找创建我自己的自定义按日期排序和按数字排序按钮,我计划将其作为右按钮放置在导航栏中。
I'm looking to create my own custom Sort By Date and Sort By Number buttons that I plan on placing in the navigation bar as the right button.
如何我的形象应该适当填补空间 - UIBarItem 文档页面没有列出图像大小的任何内容。
How big should my image be to appropriately fill the space -- the UIBarItem documentation page doesn't list anything about the size the image should be.
推荐答案
从iOS 11开始,人机界面指南建议字形大约为25次;工具栏和导航栏中的25个点,最多大约28个点。 (如果您正在使用iOS应用程序,那么HIG肯定会出现在您的书签中!)
As of iOS 11, the Human Interface Guidelines suggest glyphs be about 25×25 points in toolbars and navigation bars, up to a maximum of about 28 points. (And the HIG should definitely be in your bookmarks if you're working on iOS apps!)
对于像iPad 2 / Mini这样的旧设备,这将转换为25像素的图像,大多数现有设备(如iPhone 8或iPad)为50像素,而Retina HD设备为75像素(iPhone 6/7/8 Plus或iPhone X)。资产目录将极大地帮助保持不同资产规模的组织(Xcode甚至可以从中生成它们矢量来源这些天)。
That would translate to images 25px square for older devices like iPad 2 / Mini, 50px square for most current devices like iPhone 8 or iPad, and 75px square for Retina HD devices (the iPhone 6/7/8 Plus, or iPhone X). Asset catalogs will help immensely in keeping the different asset sizes organized (and Xcode can even generate them from vector sources these days).
这篇关于UIBarButtonItem图像应该有多大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!