hidesBottomBarWhenPushed代码中的使用
2015-11-22 本文已影响205人
代码干货
如何才能用代码实现如下效果:

使用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