you*_*afa 1 iphone xcode ios autolayout swift
我的自定义标签栏:
class MyTabBar: UITabBar {
}
My custom tab Bar Controller:
class MyTabBarController: UITabBarController {
}
Run Code Online (Sandbox Code Playgroud)
我的问题是如何在我的自定义标签栏控制器中使用我的自定义标签栏?
我通过将“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()
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1875 次 |
| 最近记录: |