-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request - overlay view in outer view controller #26
Comments
Hi, ok, I understand the problem. I'll take a look at what I can do and come back to you. If you have any solution to solve this, let me know. |
I took a look at various approaches to solve your problem. I thought about two solutions:
The first option is the easiest but doesn't always play well with a transparent navigation bar, since the background view cannot be drawn under the navigation bar anymore. The second option is probably the best choice in your case, unless the menu is too long and needs to be scrollable (with this option it wouldn't extend all the way to the bottom). To support the second option, I introduced a new API to support custom hide/show transitions for
The changes have been committed in master (using Swift 5). Now you can write something like this to have the tab bar appearing under the menu overlay: let footer = UIView()
func viewDidLoad() {
super.viewDidLoad()
let tabView = tabBarController.view
footer.translatesAutoresizingMaskIntoConstraints = false
footer.isHidden = false
footer.backgroundColor = .black
footer.alpha = 0
tabView.addSubview(footer)
NSLayoutConstraint.activate([
footer.widthAnchor.constraint(equalTo: tabView.widthAnchor),
footer.topAnchor.constraint(equalTo: tabBarController.tabBar.topAnchor),
footer.bottomAnchor.constraint(equalTo: tabView.bottomAnchor),
footer.leftAnchor.constraint(equalTo: tabView.leftAnchor)
])
navigationBarMenu.transition.show.append(.init(
before: { self.footer.isHidden = false },
change: { self.footer.alpha = 0.7 }
))
navigationBarMenu.transition.hide.append(.init(
change: { self.footer.alpha = 0 },
after: { self.footer.isHidden = true }
))
footer.addGestureRecognizer(UITapGestureRecognizer(
target: navigationBarMenu,
action: #selector(DropDownMenu.tap(_:))
))
} |
In my case
UITabBarController
is root. So if I add this control into inner navigation bar then it won't overlayUITabBar
andUITabBarController
is still clickableThe text was updated successfully, but these errors were encountered: