【问题标题】:Is there a way to change the image position in UITabBar or UITabBarItem?有没有办法改变 UITabBar 或 UITabBarItem 中的图像位置?
【发布时间】:2021-01-01 19:53:56
【问题描述】:

所以,我为 TabBarItem 创建了太大的图像,并且图像的某些部分超出了 TabBar 的顶部

Image here

我可以:

  1. 调整 Image.xassets 中所有图像的大小
  2. 编写一个函数来调整图像大小,使其适合 TabBarItem 区域

我在网上搜索但找不到解决方案。 可以做2号吗?谢谢!

【问题讨论】:

标签: swift xcode uitabbarcontroller uitabbaritem


【解决方案1】:

如 HIG(Apple 人机界面指南)中所述,标签栏图标的大小在常规模式下应为 69px × 69px (23pt × 23pt @3x)51px × 51px (17pt × 17pt @3x) 用于紧凑模式。我建议解决方案一并调整所有标签栏图像的大小。

您可以在 HIG 中阅读更多内容:

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

【讨论】:

  • 谢谢!我想我将不得不遵循 Apple 指南。将花时间调整它们的大小。谢谢!
猜你喜欢
  • 2012-11-17
  • 1970-01-01
  • 2012-07-05
  • 2012-10-27
  • 2016-06-12
  • 1970-01-01
  • 1970-01-01
  • 2013-10-27
  • 2021-10-09
相关资源
最近更新 更多