【发布时间】:2019-12-28 04:21:25
【问题描述】:
我的自定义标签栏:
class MyTabBar: UITabBar {
}
My custom tab Bar Controller:
class MyTabBarController: UITabBarController {
}
我的问题是如何在自定义标签栏控制器中使用自定义标签栏?
【问题讨论】:
标签: ios swift iphone xcode autolayout
我的自定义标签栏:
class MyTabBar: UITabBar {
}
My custom tab Bar Controller:
class MyTabBarController: UITabBarController {
}
我的问题是如何在自定义标签栏控制器中使用自定义标签栏?
【问题讨论】:
标签: ios swift iphone xcode autolayout
我通过将“tabBar”的值设置为我的自定义 tabBar 来做到这一点。
setValue(MycustomTabBar(frame: tabBar.frame), forKey: "tabBar")
class MyCustomTabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
setValue(TBar(frame: tabBar.frame), forKey: "tabBar")
view.backgroundColor = .white
createShape()
}
}
【讨论】: