How can I substitute the UITabBar of UITabBarController programmatically

后端 未结 2 1528
情歌与酒
情歌与酒 2021-01-15 13:49

I need to use a subclass of the UITabBar for my project because of the following problem Why page Push animation Tabbar moving up in the iPhone X.

I do not use stor

2条回答
  •  死守一世寂寞
    2021-01-15 14:35

    You should create an instance of your custom tab bar and override the tabBar property inside your UITabBarController subclass with it.

    class CustomTabBarController: UITabBarController {
        let customTabBar = CustomTabBar()
    
        override var tabBar: UITabBar {
            return customTabBar
        }
    }    
    

提交回复
热议问题