AZDropdownMenu icon indicating copy to clipboard operation
AZDropdownMenu copied to clipboard

The menu's position get shifted with the screen

Open martintjandra opened this issue 8 years ago • 2 comments

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?

martintjandra avatar Jun 13 '16 07:06 martintjandra

Normal: simulator screen shot jun 13 2016 2 19 11 pm

Scrolled up a little: simulator screen shot jun 13 2016 2 13 30 pm

martintjandra avatar Jun 13 '16 07:06 martintjandra

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)
}`

eddy80310 avatar Sep 08 '16 04:09 eddy80310