Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS MMDrawerController's left menu table view content is shifted down after displayed

I'm using MMDrawerController, but got a problem: When left/right menu (drawer) is opened first time (after app launched) its content is shifted down after displayed. Please see image below (sorry for the big image but slow motion makes it easier to see this problem). This image is captured from sample app of MMDrawerController: KitchenSink MMDrawerController left menu content shifted

like image 699
Yaiba Avatar asked Jan 16 '26 22:01

Yaiba


1 Answers

It's because of the status bar, I heard. Try this fix:

The first time either a left or right view controller is displayed, its content appears to be pushed down and into place once the VC is finished animating in. This looks like an issue with MMDrawerController as well. The comment here seems to fix it. The short and sweet is this:

Add the following line to the viewWillAppear:animated method of your SideViewController:

self.navigationController?.view.layoutSubviews()

So it looks something like this:

override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) // Workaround for DrawerController issue with iOS 8 self.navigationController?.view.layoutSubviews() }

Source: https://github.com/sascha/DrawerController/issues/12

like image 134
Diathedia Avatar answered Jan 19 '26 11:01

Diathedia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!