0

I am using ECSlidingMenu with my project and I need to change rootview manually so I use this code

UINavigationController *transferView = [self.storyboard instantiateViewControllerWithIdentifier:@"Transfer"];

        [self.slidingViewController anchorTopViewOffScreenTo:ECRight animations:nil onComplete:^{
            CGRect frame = self.slidingViewController.topViewController.view.frame;
            self.slidingViewController.topViewController = transferView;
            self.slidingViewController.topViewController.view.frame = frame;
            [self.slidingViewController resetTopView];
        }];

after resetTopView , I got black weird bar as you see in image.

If I run the code (Change RootView Again) black bar will grow higher.

Does anyone undergo this issue?

Screenshot

Nut Tang
  • 66
  • 5
  • Is this code in the current `topViewController`? Is the frame being set? – Wain Feb 06 '14 at 12:53
  • Yes, following code is set in My FirstViewController and I want to change view from FirstView -> TransferViewController. – Nut Tang Feb 06 '14 at 12:59
  • So is the frame set? And does it animate back? Debug to check the frame and if anything else is changing the frame. – Wain Feb 06 '14 at 13:01
  • I already check it, frame size was changed after resetTopView. But I didn't 'Debug' in ECSlingViewController code. – Nut Tang Feb 06 '14 at 13:12
  • Finally, I can fix it. after search similar problem. – Nut Tang Feb 06 '14 at 13:13

1 Answers1

1

Just change code to be like this.

ECSlidingViewController *slidingViewController = self.slidingViewController;

[slidingViewController anchorTopViewOffScreenTo:ECRight animations:nil onComplete:^{
    CGRect frame = slidingViewController.topViewController.view.frame;
    slidingViewController.topViewController = transferView;
    slidingViewController.topViewController.view.frame = frame;
    [slidingViewController resetTopView];
}];

this solve problem. I have no idea why... but it's worked.

Thank you :--> Switching views with ECSliding without navigation menu

Community
  • 1
  • 1
Nut Tang
  • 66
  • 5