autresphere / ASDepthModal

An Objective-C class that adds a sense of depth to your modal popup views.
MIT License
430 stars 74 forks source link

tar bar not hidden after popup view dismissed [iOS 7] #20

Closed stattrak-dragonlore closed 8 years ago

stattrak-dragonlore commented 11 years ago

In iOS 7:

View Controller a.hidesBottomBarWhenPushed = YES;

So the tar bar is hidden when a is pushed.

But the tar bar is shown when aPopupView dismiss:

[ASDepthModalViewController presentView:aPopupView];
lulucom commented 10 years ago

This is my workaround:

ViewController.m (has tab bar)

a.hidesBottomBarWhenPushed = YES;

AViewController.m (hides tab bar)

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    if ([self.navigationController.viewControllers indexOfObject:self] == NSNotFound) {
        // back button was pressed.  We know this is true because self is no longer in the navigation stack.
        self.tabBarController.tabBar.hidden = NO;
    }

    [super viewWillDisappear:animated];
}
easyin999 commented 8 years ago

Thinks,it solved my problem