Open ruixingchen opened 8 years ago
I have a view with distance 16 to the top , but I find it wrong when runs on simulator
sometimes it happens , but sometimes not , that is very strange
my code
SlideMenuOptions.contentViewScale = 1 SlideMenuOptions.hideStatusBar = false SlideMenuOptions.contentViewOpacity = 0.35 SlideMenuOptions.separateGestureFromScrollViewInMainViewController = true SlideMenuOptions.lockGestureDirection = true SlideMenuOptions.pointOfNoReturnWidth = SlideMenuOptions.leftViewWidth/2 //控制滑动多少会自动回弹或者自动弹出 switch Device.size(){ case .Screen3_5Inch,.Screen4Inch: SlideMenuOptions.leftViewWidth = 220 case .Screen4_7Inch,.Screen5_5Inch: SlideMenuOptions.leftViewWidth = 300 case .UnknownSize: break } let main = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier(MainViewController.storyboardIdentifierNav) let left = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier(LeftViewController.storyboardIdentifier) let slide = SlideMenu(mainViewController: main, leftMenuViewController: left) self.window?.rootViewController = slide
find what happened : when present a VC and then dismiss it,this problem will happen, but I dont know how to fix it
find solution in viewWillAppear:
self.view.setNeedsUpdateConstraints()
I have a view with distance 16 to the top , but I find it wrong when runs on simulator
sometimes it happens , but sometimes not , that is very strange
my code