Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional Blank left-side drawer controller #30

Closed
shiyunhe opened this issue May 26, 2013 · 30 comments
Closed

Occasional Blank left-side drawer controller #30

shiyunhe opened this issue May 26, 2013 · 30 comments
Labels

Comments

@shiyunhe
Copy link

Occasionally, the left side drawer controller can be blank.

img_2850
img_2849

@kcharwood
Copy link
Contributor

Can you provide any more context that may help this? Panning? Toggling? Any custom drawer animations?

@shiyunhe
Copy link
Author

I think that it happened when toggled. The app doesn't use an custom drawer animations.

It rarely happens. If it does happen, just hide the side drawer controller and show it again. It will start to work again.

If I have more information that can help fixe the bug, I will post it here.

@kcharwood
Copy link
Contributor

I've beat on this pretty hard, and can't seem to figure out how to reproduce it. I'll close this for now. If you can encounter it again or provide some repo steps, feel free to open it back up.

@linkov
Copy link

linkov commented Jul 8, 2013

Hey guys, is this still happening in the latest Release ? Shiyunhe, did you manage to find more info on this behaviour?

@shiyunhe
Copy link
Author

shiyunhe commented Jul 8, 2013

It is still happening using the latest release.

I used the following method to open/close left side drawer from MMDrawerController:

-(void)toggleDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;

I just switch to using more specific methods to open or close and will let you know whether if these method helps:

-(void)closeDrawerAnimated:(BOOL)animated completion:(void(^)(BOOL finished))completion;
-(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;

If the code are analyzed by xcode, you can find the following issues:

screen shot 2013-07-08 at 6 20 37 pm

screen shot 2013-07-08 at 6 20 24 pm

I am wondering whether the these issues can cause the left blank drawer.

@kcharwood
Copy link
Contributor

I don't think that would cause the problem. Those warnings are coming up because line 35 is never initialized, and there is a case where that value is never touched (if drawerSide == MMDrawerSideNone). It shouldnt matter because the drawer should never be none (if it is, that is the root cause of the problem). You could try setting line 35 to CATransform3DIdentity and see if that fixes the problem for you.

Is it only happening with the slideAndScale animation?

@kcharwood kcharwood reopened this Jul 8, 2013
@wanily
Copy link

wanily commented Jul 11, 2013

me too,the same appearance。it‘s only happening with the toggleDrawerSide method。

-(void)toggleDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;

@viezel
Copy link

viezel commented Jul 11, 2013

I can confirm that MMDrawerSideNone happens alot. Especially when only one of the side ViewController are used. Maybe add something like:

^(MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible){     
    if(drawerSide == MMDrawerSideNone){
        NSLog(@"SideNone");
        return;
    }

that should work right?

@kcharwood
Copy link
Contributor

Can we summarize if this is happening for a specific drawer animation, or all drawer animations? I still haven't been able to repro this...

@kcharwood
Copy link
Contributor

I think we have this fixed. If anyone see its again, feel free to reopen the issue.

@shiyunhe
Copy link
Author

The issue still happens on iOS 7 using the latest update.

@EvgeniyGT
Copy link

This is still happens for me on iOS6.
But I can't reproduce...

@shiyunhe
Copy link
Author

It happens quite frequently on iOS simulator and device. Closing and reopening left drawer will fix the issue.

It is still unclear to me why this happens. I guess that it is related to iOS memory warning:

  • Left drawer's views are somehow purged during memory warning
  • Those views are not properly reloaded by MMDrawerController when left drawer is open

ios simulator screen shot oct 22 2013 12 17 02 pm

@ayanonagon
Copy link

Still seeing this as well on 0.5.1 (definitely on iOS 7, not sure about other versions). Can we reopen the issue?

Love the project, btw :octocat: 👍

@kcharwood
Copy link
Contributor

I'll reopen the issue, but haven't seen it myself yet. Please file any and all related information in this issue to help debug.

@kcharwood kcharwood reopened this Oct 28, 2013
@ayanonagon
Copy link

@kcharwood I found a way to reproduce this issue. I haven't found a way to persist the disappearance, but I can get the drawer to flash and disappear (which is most definitely related).

Steps to reproduce:
(1) Open drawer.
(2) Select item in drawer that would cause the drawer to animate close.
(3) Here's the tricky part: While the drawer is closing, grab it and open it. You'll notice that the content of the drawer disappears for a second.

It seems like the issue is that begin and end animation calls are happening in different methods, and there are some edge cases where it gets the drawer in a strange state where it looks like it disappeared.

Let me know if this helps at all.

:octocat:

@antonholmquist
Copy link
Contributor

I investigated this problem in a project a few weeks ago, and I found part of the reason for the bug. It's due to self.centerContainerView.frame.origin.xending up at 0.5 instead of 0 when closing the drawer. This makes drawerFullyCovered get an incorrect value shortly afterwards which makes the drawer view controller stay hidden.

The commit below contains a dirty quickix, but it doesn't attack the actual origin, so some further research as to why this happen is needed. This should give a step in the right direction.
antonholmquist@4b42c34

@ayanonagon
Copy link

@antonholmquist Thanks for the info. We'll try that and see if we stop seeing the bug.

:octocat:

@EvgeniyGT
Copy link

ayanonagon

This fix works??

@ayanonagon
Copy link

@EvgeniyGT It seems to. Haven't seen the persistent disappearing drawer since then.

antonholmquist added a commit to antonholmquist/MMDrawerController that referenced this issue Nov 13, 2013
mutualmobile#30

For some reason self.centerContainerView.frame.origin.x is sometimes being set to 0.5 at the end of close animation. This causes drawerFullyCovered to be incorrectly set to false. 

Note: This is just a quickfix. The actual reason of why origin.x is being set to 0.5 in the first place should be investigated and corrected in a future version.
@antonholmquist
Copy link
Contributor

Since this seemed to fix the issue for me and @ayanonagon, I created a pull request with a quickfix of the issue. Since it may help some people and likely doesn't break anything I guess it would make sense to merge until the cause of the problem is found.

@jupanubv92
Copy link

I have this issue when I'm trying to close the drawer on orientation change.

This is the center view controller:
screen shot 2013-11-17 at 9 42 14 pm

This is the right view controller:
screen shot 2013-11-17 at 9 43 06 pm

Now when the device orientation changes to landscape I call

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
  [self.mm_drawerController closeDrawerAnimated:NO completion:nil];
}

In 0.3.0 closing the drawer while animating to landscape was possible, now when I'm trying to do this, the right controller become black and it doesn't close.

Here is a screenshot from 0.3.0
screen shot 2013-11-17 at 9 52 24 pm

And here is a screenshot using 0.5.1
screen shot 2013-11-17 at 9 52 34 pm

And this is how it looks when I go back in portrait mode
screen shot 2013-11-17 at 9 55 35 pm

I had the black left side drawer issue in 0.3.0, but it looks like in 0.5.1 the left side is fixed, but now the right side has the above bug.

As a temporal solution I closed the drawer after the rotation:

- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
  [self.mm_drawerController closeDrawerAnimated:YES completion:nil];
}

@nspavlo
Copy link

nspavlo commented Nov 20, 2013

  1. Open MMDrawerControllerKitchenSink
  2. Set LeftDrawerAnimation to None
  3. Open left menu.
  4. Tap Full View Change as fast as and as many times you can!!!

And left drawer goes black!

@antonholmquist
Copy link
Contributor

@nspavlo, I tried what you suggested and found the cause of that particular issue. It should be resolved in this commit: #173

It's too early to say if this fix solves the blank drawer issue for everyone but it definitely fixes a potential bug.

@kcharwood
Copy link
Contributor

@nspavlo Your steps have been very helpful. I've reproduced that behavior, and also was able to dig deeper to understand root cause. Should have a patch up in the next day or so.

Cheers!

@kcharwood
Copy link
Contributor

@jupanubv92 Could you create a separate issue with your information. I think those might be different. Also, let me know if you can reproduce that with the example app.

kcharwood added a commit that referenced this issue Jan 29, 2014
@kcharwood
Copy link
Contributor

I have pushed up #211

@antonholmquist your PR was very helpful, and helped me trackdown what i think was the root cause of the issue - Accepting new gestures while an animation was in progress.

I'm going to close this out again, and hopefully we've got it for real this time.

@cliftonlabrum
Copy link

Which version is this supposed to be fixed in? I have a blank left drawer on every orientation change on iPad. I'm using MMDrawerController 0.5.7.

On orientation change, I open/close the drawer programmatically. I can confirm that setting animated to NO eliminates the bug.

Rotate to landscape:

//Broken: left drawer goes blank
[drawerController openDrawerSide:MMDrawerSideLeft animated:YES completion:nil];

//Works: left drawer does *not* go blank
[drawerController openDrawerSide:MMDrawerSideLeft animated:NO completion:nil];

I hope that helps.

@lionel-SF
Copy link

Hello, friends

i meet this and reproduce it.
At LeftSideViewController we set difference url addresses which is a UITableViewController,
At CenterViewController we set a weView to load the url from leftsideVC; so we can klick left side tableView and change the url address we want.
Important: we want the web view to handle the session cookie for url, so we do not need login again after invalid.After my APP enter background more than 30 minutes, the session cookie is invalid, login again by using TouchID then see the same page, but it failures , and show the TouchID again , and TouchID success then you will login success and find the left side VC black.
More: This only happened at APP install by ipa file style. and we set the session valid time to 1 minute at DEBUG ,we do not see it, so it hard for me to follow debug.
Looking forward, who can help ? or any ideas.
img_4986

@lionel-SF
Copy link

it must happen after session invalid (30 minute enter background), and TouchID check success 2 times login then black left side vc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests