erichoracek / MSDynamicsDrawerViewController

Container view controller that leverages UIKit Dynamics to provide a realistic drawer navigation paradigm.
MIT License
3.2k stars 396 forks source link

Misplaced pane view after iOS 7.1 #99

Closed eclopez closed 2 years ago

eclopez commented 10 years ago

I've recently noticed an issue where a pane view's frame will sometimes appear at the top of the screen so that the navigation bar is partially covered by the status bar. I suspect iOS 7.1 is the culprit since I didn't notice if before the update. Complicating the issue further is that I cannot find steps to reliably reproduce; it happens to seemingly random pane view controllers (which have all been UITableViewControllers), though it will happen eventually for me if I keep navigating through an app. I've attached a screen shot of it happening in the example app. I'm using iOS 7.1 and the device used for testing is an iPhone 5C. Also, I am NOT using Storyboard.

Thanks!

photo

lluisgerard commented 10 years ago

I also noticed this strange behavior with iOS 7.1 but don't understand exactly when or why it happens. It happened a lot on one of my projects and I fixed it setting setGravityMagnitude to 4 instead of default (2) but don't know exactly why. I'm not using storyboards either and I'm using Masonry library for AutoLayout. In fact I started an issue on Masonry https://github.com/cloudkite/Masonry/issues/51 but closed it because I couldn't tell who to was to "blame" and I'm very busy these days to start a project to replicate the issue.

In my case, it's triggered, clearly, by adding subviews while the viewController is not entirely on the screen. (With default gravity)

I still have an iOS 7 device so I can compare. There is a little glitch with iOS 7.1 (at least in my project) when the viewController appears, is like it's repositioning itself for a moment by a pixel. Is not too noticeable but is really clear when you see both iOS 7 and iOS 7.1 (same code) at the same time.

eclopez commented 10 years ago

It happens in my app in blank, plain, UITableView controllers that I have yet to implement, so in my case, subviews aren't a factor. Also, all MSDynamicsDrawerViewController settings are default, except for Pane Drag Requires Screen Edge is true.

crafterm commented 10 years ago

Not much to add but I'm also experiencing the exact same issue (latest master, iOS7.1), just with mostly empty view controllers holding a single label.

Following @lluisgerard advice/workaround - setting gravity to 4 magically fixed it in my case as well!

forthenature commented 10 years ago

Everything is ok before I presented a modalview from the paneview then dismiss to comeback to the pane view, I have the same issue. Then I found that if I annotation the following code in MSDynamicsDrawerViewController.m, it works fine. I don't know why.