【问题标题】:Using UITabBar.ItemPositioning in iOS 13在 iOS 13 中使用 UITabBar.ItemPositioning
【发布时间】:2019-10-18 21:07:46
【问题描述】:

我的UITabBarController 只有两个项目,我想将它们显示得更紧密。这在 XCode 10 / iOS 12 中对我有用:

override func viewDidLoad() {
    super.viewDidLoad()        
    tabBarController?.tabBar.itemPositioning = .centered
}

但是,它不再适用于 XCode 11 / iOS 13 - 项目以默认方式隔开。

文档现在 refersUITabBar.ItemPositioning 为“旧版自定义”。那么应该用什么来代替呢?

【问题讨论】:

  • 您是否尝试从 Interface Builder 更改 Tabbar Item Positioning 属性?
  • 确实有帮助,谢谢!请提交作为答案,我会接受。

标签: ios swift uikit uitabbar ios13


【解决方案1】:

您可以从界面生成器中进行设置。 Select TabBar -> Attribute Inspector -> Item Position -> Center 然后您将获得项目间距选项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-25
    • 2020-02-25
    • 1970-01-01
    • 1970-01-01
    • 2020-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多