导航栏遮盖视图解决办法
作者:
_Jock羁 | 来源:发表于
2018-05-20 11:11 被阅读29次- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
// 方法一
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
// 方法二
self.edgesForExtendedLayout =UIRectEdgeNone;
self.automaticallyAdjustsScrollViewInsets = NO;
// 方法三
self.edgesForExtendedLayout =UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = YES;
// 方法四
if( ([[[UIDevice currentDevice] systemVersion] doubleValue]>=7.0)) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
}
//方法五
ViewController *vc = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
//tabBar跳转后不隐藏也可导致顶部被遮挡
vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];
本文标题:导航栏遮盖视图解决办法
本文链接:https://www.haomeiwen.com/subject/yigzdftx.html
网友评论