Strange animation on iOS 7 when using hidesBottomB

2019-03-17 13:58发布

This problem comes when I build an app targeting iOS 5 or 6, but run it on iOS 7. If I have a controller in a navigationController that is a part of a tabBarController, and I do the following:

controller.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:testController animated:YES];

A strange vertical positioning animation occurs. I would instead like the new controller (with the bottom bar hidden) to push or pop on the navigation controller pushing the tab bar out or bringing it back and with no vertical positioning changes.

Video of Issue: http://cl.ly/1w0g3j293m03

Open Radar Report: http://www.openradar.me/14670329

6条回答
等我变得足够好
2楼-- · 2019-03-17 14:15

Just set the translucent property to NO for both navigation bar and tabBarController. This will solve your problem.

查看更多
Bombasti
3楼-- · 2019-03-17 14:22

Try This:

[self.navigationController.navigationBar setHidden:NO];
查看更多
放我归山
4楼-- · 2019-03-17 14:29

If you want to keep transparency, add this to the root UIViewController:

- (void)viewWillAppear:(BOOL)animated {
    [UIView animateWithDuration:0.35f animations:^{
        self.tabBarController.tabBar.alpha = 1.0f;
    }];
}

- (void)viewWillDisappear:(BOOL)animated {
    [UIView animateWithDuration:0.35f animations:^{
        self.tabBarController.tabBar.alpha = 0.0f;
    }];
}

This way you'll get a nice fade-in/fade-out animation of the tab bar.

查看更多
趁早两清
5楼-- · 2019-03-17 14:31

this says you should put:

self.navigationController.navigationBar.translucent = NO;

follow this link

查看更多
你好瞎i
6楼-- · 2019-03-17 14:33

Try this

if( [self respondsToSelector:@selector(setEdgesForExtendedLayout:)] )
{
    self.edgesForExtendedLayout=UIRectEdgeNone;
}
查看更多
Lonely孤独者°
7楼-- · 2019-03-17 14:34

You can always remove animation from the UIView with

[self.view.layer removeAllAnimations];

Cheers

查看更多
登录 后发表回答