Skip to content
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

The Dropdownmenu won't scroll when too many items #18

Closed
rico237 opened this issue Aug 28, 2017 · 9 comments
Closed

The Dropdownmenu won't scroll when too many items #18

rico237 opened this issue Aug 28, 2017 · 9 comments

Comments

@rico237
Copy link
Contributor

rico237 commented Aug 28, 2017

I'm using this array with 19 items on it, some items are then listed outside of the iphone screen and the menu don't scroll so users can't reach the 19th elements of my array ...

["Alimentaire","Artisanat","Bien-être","Décoration","E-commerce","Distribution","Hôtellerie","Immobilier","Informatique","Métallurgie","Médical","Nautisme","Paramédical","Restauration","Sécurité","Textile","Tourisme","Transport","Urbanisme"]

The code I used to dynamically load array into your menu from your demo project

`func prepareNavigationBarMenu(_ currentChoice: String) {
navigationBarMenu = DropDownMenu(frame: view.bounds)
navigationBarMenu.delegate = self

	let toutesCat = ["Alimentaire","Artisanat","Bien-être","Décoration","E-commerce","Distribution","Hôtellerie","Immobilier","Informatique","Métallurgie","Médical","Nautisme","Paramédical","Restauration","Sécurité","Textile","Tourisme","Transport","Urbanisme"]
    var catCells : Array<DropDownMenuCell>
    catCells = []
    
    for string in toutesCat  {
        
        let cell = DropDownMenuCell()
        cell.textLabel!.text = string
        cell.menuAction = #selector(ViewController.choose(_:))
        cell.menuTarget = self
        if currentChoice == cell.textLabel!.text {
            cell.accessoryType = .checkmark
        }
        
        catCells.append(cell)
    }
    
    navigationBarMenu.menuCells = catCells
    navigationBarMenu.selectMenuCell(catCells.first!)
	
	// If we set the container to the controller view, the value must be set
	// on the hidden content offset (not the visible one)
	navigationBarMenu.visibleContentOffset =
		navigationController!.navigationBar.frame.size.height + statusBarHeight()

	// For a simple gray overlay in background
	navigationBarMenu.backgroundView = UIView(frame: navigationBarMenu.bounds)
	navigationBarMenu.backgroundView!.backgroundColor = UIColor.black
	navigationBarMenu.backgroundAlpha = 0.7
}`

Screenshot :

simulator screen shot on iPhone 7+

@sway0422
Copy link

sway0422 commented Sep 2, 2017

I've got the same issue.

@rico237
Copy link
Contributor Author

rico237 commented Sep 6, 2017

I will try to code a fix for this :)

@rico237
Copy link
Contributor Author

rico237 commented Sep 6, 2017

Done #20

@qmathe
Copy link
Owner

qmathe commented Sep 13, 2017

Thanks for the patch, I'm going to review it.

@rico237
Copy link
Contributor Author

rico237 commented Sep 13, 2017

Since we are working on a fix for this issue i can close it now :)

@rico237
Copy link
Contributor Author

rico237 commented Sep 21, 2017

Don't forget to push to cocoapods cause i'm still getting the old version without the fix via cocoapods

@qmathe
Copy link
Owner

qmathe commented Sep 22, 2017

I'll push a new version as soon as iOS 11 support is fixed (#19).

@cagdastimurlenk
Copy link

the problem is titleview in navigation bars frame is set to 0 .If you add a frame ( actually you shouldnt need to but, in IOS 11 yes) then your dropdown will start to work

@cagdastimurlenk
Copy link

qmathe , while you are pushing a new version, can you please add a property that closes the animation but show instantly when set to true.

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

No branches or pull requests

4 participants