MMDrawerController icon indicating copy to clipboard operation
MMDrawerController copied to clipboard

Navigation bar from leftDrawerController snaps at first open

Open danipralea opened this issue 11 years ago • 11 comments

Hello and congratulations for the great work on the framework.

When you first open the left drawer (I'm not using the right one, but I guess it happens for that as well), the navigation bar "snaps" a hefty bunch of pixels from the top into its place. I repeat, only for first open. The subsequent ones have no effect.

danipralea avatar Jan 16 '14 14:01 danipralea

Can you reproduce this issue in the example project? If not, can you push up an example of the problem?

Thanks!

kcharwood avatar Jan 28 '14 20:01 kcharwood

Are you hiding the status bar in your center or side drawer view controllers? I see this as well. Duplicate in the example project by adding the following in MMExampleCenterTableViewController.m, MMExampleSideDrawerViewController.m, or both.

-(BOOL)prefersStatusBarHidden
{
    return YES;
}

I'm currently looking to see if any pull requests have addressed this.

stevekohls avatar Feb 15 '14 15:02 stevekohls

@kcharwood, it could be reproduced in the MMDrawerControllerKitchenSink project (tag 0.5.6) for the rightDrawerController. But it happens if only landscape orientation is allowed.

Steps to reproduce:

  1. Clear Portrait and Upside Down flags in the Device Orientation settings
  2. Launch iPhone app in iOS Simulator
  3. Press the button (don't use gestures) to open the right drawer. The navigation bar snaps when the right drawer is opened first time.

viacheslavkorotaiev avatar Jul 01 '14 08:07 viacheslavkorotaiev

thanks @viacheslavkorotaiev

I can reproduce that.

kcharwood avatar Aug 25 '14 13:08 kcharwood

I'm working on an update for iOS 8, and can reproduce the problem in my app in my left drawer consistently, regardless of rotation/orientation settings. I downloaded the Sample Project, and was able to reproduce the problem in that project as well as long as I built against iOS 8.

It looks like the first time you open either drawer, the first table header grows in height by about 40px, which causes the visual jump other users have reported.

djibouti33 avatar Aug 25 '14 23:08 djibouti33

I'm seeing this issue or something similar to this while working with iOS 8. I have a UINavigationController holding a UICollectionViewController as my right drawer. When I open the drawer the first time, the content of the collection view visibly snaps down into place below the nav bar. Doesn't happen on subsequent opens. It seems to be related to the automaticallyAdjustsScrollViewInsets property on UIViewController. If I disable that in viewDidLoad and manually set the the contentInset of my collection view (64px in my case), the issue goes away. This isn't ideal, of course.

ghost avatar Aug 27 '14 19:08 ghost

Same here when built with iOS 8. But if you drag to open side drawer the first time, there's no issue at all.

xkmo avatar Sep 16 '14 01:09 xkmo

Same here. Happens on iOS 8.1 on programmatically opening the left drawer. Still no solution for this from anyone?

Jeehut avatar Dec 16 '14 13:12 Jeehut

I have found a workaround to fix this. Simply add the following line to your viewWillAppear in your sidebar controller:

Swift: self.navigationController?.view.layoutSubviews() ObjC: [self.navigationController.view layoutSubviews]

Good luck!

Jeehut avatar Jan 11 '15 16:01 Jeehut

Yes, it's work @Dschee Many thanks!

zkasman avatar Jan 16 '15 19:01 zkasman

Thanks @Dschee

Terens777 avatar Feb 08 '18 22:02 Terens777