UIBarButtonItem 图像应该有多大?

How big should a UIBarButtonItem image be?(UIBarButtonItem 图像应该有多大?)

本文介绍了UIBarButtonItem 图像应该有多大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找创建自己的自定义按日期排序"和按数字排序"按钮,我计划将它们放在导航栏中作为右侧按钮.

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 设备(iPhone 6/7/8 Plus 或 iPhone)的 75 像素正方形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 图像应该有多大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:UIBarButtonItem 图像应该有多大?

基础教程推荐