有没有可能在iOS 12+中的UITabbarController中对某些但不是所有的选项卡进行重新排序?
我在故事板上找了一个相关的UITabbarDelegate或一个选项,但没有成功。
我的想法是使用delegate函数func tabBar(_ tabBar: UITabBar, willBeginCustomizing items: [UITabBarItem])并调用带有可排序项的超级实现。但这没有效果。

class TabbarController: UITabBarController
{
    override func tabBar(_ tabBar: UITabBar, willBeginCustomizing items: [UITabBarItem]) {
        super.tabBar(tabBar, willBeginCustomizing: [items.first!])
    }
}

最佳答案

取自here
默认情况下,允许用户重新排列选项卡栏上的所有项目。但是,如果不希望用户修改某些项,则可以从customizableViewControllers属性的数组中删除相应的视图控制器。
这就是你要找的吗?

关于ios - 使UITabViewController中的某些但不是全部选项卡可重新排序,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57147006/

10-12 00:15
查看更多