AZDropdownMenu
AZDropdownMenu copied to clipboard
The menu's position get shifted with the screen
I use this plugin with UITableViewController. When I scroll the table up, the menu's position get shifted up too offscreen. How to fix this?
Normal:
Scrolled up a little:
under AZDropDownMenu.swift I had to change it to
` private func initMenu() { var navBarHeight = UINavigationController().navigationBar.frame.size.height var statusBarHeight = UIApplication.sharedApplication().statusBarFrame.size.height
let frame = UIScreen.mainScreen().bounds
let menuFrame = CGRectMake(0, navBarHeight + statusBarHeight, frame.size.width, menuHeight)
menuView = UITableView(frame: menuFrame, style: .Plain)
menuView.userInteractionEnabled = true
menuView.rowHeight = CGFloat(itemHeight)
if self.reuseId == nil {
self.reuseId = DROPDOWN_MENU_CELL_KEY
}
menuView.dataSource = self
menuView.delegate = self
menuView.scrollEnabled = false
menuView.accessibilityIdentifier = "MENU"
menuView.separatorColor = menuConfig?.menuSeparatorColor
let panGesture = UIPanGestureRecognizer(target: self, action: #selector(AZDropdownMenu.handlePan(_:)))
panGesture.delegate = self
menuView.addGestureRecognizer(panGesture)
addSubview(menuView)
}`