标签栏图标大小 [英] Tab Bar Icon Size

查看:444
本文介绍了标签栏图标大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple :

根据设备和方向,系统会显示常规或紧凑的选项卡栏.您的应用应包含两种尺寸的自定义标签栏图标.

Depending on the device and orientation, the system displays either a regular or compact tab bar. Your app should include custom tab bar icons for both sizes.

不幸的是,它们无法指定您何时获得.

Unfortunately, they fail to specify when you get which.

我也可能同时包括这两种尺寸的图像,但是系统会自动在它们之间切换(如何?)还是我必须自己做?

Also I might include those images for both sizes, but will the system switch between them automatically (how?) or do I have to do it myself?

推荐答案

您不应自己执行此操作,否则系统可以自动执行此操作.

You should not do this yourself system can do it automatically.

这是Apple人机界面指南,您可以在其中找到图标分辨率: https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/custom-icons/

here is Apple Human Interface Guidelines, where you can find icon resolutions: https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/custom-icons/

例如: 如果将圆形图标用于标签栏项目,则应为纵向模式创建以下尺寸:

for example: If you are using circular icons for tab bar item you should create following sizes for portrait mode:

  • 75px×75px(25pt×25pt @ 3x)
  • 50px×50px(25pt×25pt @ 2x)
  • 25px×25px(25pt×25pt @ 1x)

,对于横向模式:

  • 54px×54px(18pt×18pt @ 3x)
  • 36像素×36像素(18pt×18pt @ 2x)
  • 18px×18px(18pt×18pt @ 1x)

在将此图标添加到Assets.xcassets或某处之后,可以从情节提要中选择标签栏项目"图标:

after you add this icons into Assets.xcassets or somewhere, you can select Tab Bar Item icons from storyboard:

选择选项卡栏"项,然后在属性检查器中,选择肖像"图像作为图像字段,选择风景"图像作为风景"字段.

select Tab Bar item and in the attributes inspector, choose portrait image for image field, and landscape image for landscape field.

在那之后,系统将为您做一切.

After that system will do everything for you.

这篇关于标签栏图标大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆