Open nikolindima opened 4 years ago
sample code? Video? any more details?
i fix it. but don't know how to make commit public var viewControllers: [UIViewController] = [] { didSet { var i = Int(viewControllers.count) - 1 while i >= 0 { let vc = viewControllers[i] if let vcView = vc.view, let tabBar = tabBar { self.view.insertSubview(vcView, belowSubview: tabBar) vcView.snp.makeConstraints { (make) in make.top.equalToSuperview() make.leading.equalToSuperview() make.trailing.equalToSuperview() make.bottom.equalTo(tabBar.snp.top) } } i -= 1 } } }
need to add constraints to view
Create pull request #64
As I say. views goes under tabbar. This is your example project
Same issue - when using a VC with content, nothing displays. The debug hierarchy shows nothing for the view. I created a simple VC with a single label - "zero". All VC's show in the hierarchy, but the view itself, for the VC that has 'zero' is showing its content on the tab bar controller. Any VC with real content, always shows up with nothing, and black background (picture included).
It appears that the view lifecycle is not complete by the time the tab bar controller gets the view, so it has nothing to render yet. If the VC bg color is set in viewDidLoad, you do see that color, but none of the components from the IB ... something is not handled in the correct order.
Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in self.view.addSubview(baTabBarController.view) }
Try this in your didload
views goes under tabbar