hussc / lightCardTabBar

Different Styles of Custom Tab Bar
36 stars 3 forks source link

Bottom Constraint issue #3

Open Bejil opened 3 years ago

Bejil commented 3 years ago

It seems that hiding the tabBar create side effect with the bottom constraint of the controllers added to the tabBar. Using Snapkit:

placeholderView.snp.makeConstraints { make in
    make.top.equalTo(view.safeAreaLayoutGuide).inset(UI.Margins)
    make.bottom.equalTo(view.safeAreaLayoutGuide).inset(UI.Margins)
    make.right.left.equalToSuperview()
}

placeholderView is under the tabBar when it's hidden.

tabBar.alpha = 0.0
tabBar.isUserInteractionEnabled = false

these two lines fix the issue