Open ruixingchen opened 8 years ago
sorry ,the picture may not be clear ,here it clear is
Same problem here.
Save problem
@ruixingchen How do you set before instance of the SlideMenuController?
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
@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()
@filipepipeline @ruixingchen Please try to configure the settings in SlideMenuOptions before the instantiation of SlideMenuController.
Since confusing, it will stop the static option, I guess had better to pass the option in init..
@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
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.
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!