dekatotoro / SlideMenuControllerSwift

iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.
MIT License
3.4k stars 755 forks source link

your job is excellent, but I still find some problem about leftViewWidth #91

Open ruixingchen opened 8 years ago

ruixingchen commented 8 years ago

image

I change leftViewWidth to 50 ,then openLeft and closeLeft , leftView goes 270 from left to right, but goes 50 from right to left (it should be 50 from left to right and 50 from right to left), then it was like the image above,I only changed the leftViewWidth, is there anything I should do or is there a bug in your code ? thanks again!

ruixingchen commented 8 years ago

sorry ,the picture may not be clear ,here it clear is image

filipepipeline commented 8 years ago

Same problem here.

jassadakorn commented 8 years ago

Save problem

dekatotoro commented 8 years ago

@ruixingchen How do you set before instance of the SlideMenuController?

filipepipeline commented 8 years ago

Thats what I did.

    slideMenuController = SlideMenuController(mainViewController: mainViewController!, leftMenuViewController: leftViewController)
    SlideMenuOptions.contentViewOpacity = 0
    SlideMenuOptions.leftBezelWidth = 20.0
    SlideMenuOptions.contentViewScale = 1
    SlideMenuOptions.hideStatusBar = false
    SlideMenuOptions.panFromBezel = false
ruixingchen commented 8 years ago

@dekatotoro in AppDelegate

    window?.rootViewController = SlideContainer(mainViewController: UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("ClassTable") as! ClassTableViewController, leftMenuViewController: UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("Left") as! LeftViewController)

//slideContainer is a subclass of SlideMenuController

    SlideMenuOptions.contentViewScale = 1.0
    SlideMenuOptions.hideStatusBar = false
    SlideMenuOptions.leftBezelWidth = 50
    SlideMenuOptions.leftViewWidth = 50  //this is the line cause the problem

    window?.makeKeyAndVisible()
dekatotoro commented 8 years ago

@filipepipeline @ruixingchen Please try to configure the settings in SlideMenuOptions before the instantiation of SlideMenuController.

dekatotoro commented 8 years ago

Since confusing, it will stop the static option, I guess had better to pass the option in init..

ruixingchen commented 8 years ago

@dekatotoro
configure slideMenuOption before instantiation solves ,thank you ,and set option in init is a good idea but may cause a huge slice of code, that is really annoying

Vrezhg commented 7 years ago
SlideMenuOptions.leftViewWidth = (self.window?.frame.width)! * 0.75
let slideMenuController = SlideMenuController(mainViewController: main,leftMenuViewController: left)

Setting the slide menu options before setting up the controller will solve your problem, I would also recommend setting the width relative to the current width of the screen so it looks similar for all screen sizes rather than setting a constant width.