Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

The menu's position get shifted with the screen #23

Open
martintjandra opened this issue Jun 13, 2016 · 2 comments
Open

The menu's position get shifted with the screen #23

martintjandra opened this issue Jun 13, 2016 · 2 comments

Comments

@martintjandra
Copy link

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
Copy link
Author

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

@eddy80310
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants