如何才能用代码实现如下效果:
![](https://img.haomeiwen.com/i317394/667f041fffb9a445.gif)
使用storyboad的方法我就不多说了大家可以参考如下文章:
代码和xib实现如下:
方法1:
<pre>
ViewController2 *vc = [[ViewController2 alloc] init];
vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
</pre>
方法2;
<pre>
self.hidesBottomBarWhenPushed = YES;
ViewController3 *vc = [[ViewController3 alloc] initWithNibName:@"ViewController3" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
self.hidesBottomBarWhenPushed = NO;
</pre>
参考文章:
iOS:hidesBottomBarWhenPushed的正确用法
iOS跳转界面时隐藏tabBar的方法:hidesBottomBarWhenPushed
网友评论