BATabBarController icon indicating copy to clipboard operation
BATabBarController copied to clipboard

views goes under tabbar

Open nikolindima opened this issue 4 years ago • 7 comments

views goes under tabbar

nikolindima avatar Apr 20 '20 13:04 nikolindima

sample code? Video? any more details?

antiguab avatar Apr 20 '20 13:04 antiguab

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

nikolindima avatar Apr 20 '20 13:04 nikolindima

Create pull request #64

nikolindima avatar Apr 20 '20 14:04 nikolindima

As I say. views goes under tabbar. This is your example project

screen

nikolindima avatar Apr 20 '20 20:04 nikolindima

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).

Screen Shot 2020-05-25 at 7 00 42 AM

pkasson avatar May 25 '20 10:05 pkasson

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.

pkasson avatar May 25 '20 19:05 pkasson

Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { _ in self.view.addSubview(baTabBarController.view) }

Try this in your didload

ghost avatar Sep 07 '20 07:09 ghost