ios7适配--navgationbar遮住下面view的处理

Have you guys stumbled up on this issue ?

Basically in iOS 7 Navigation Controller is rendered over the sub-view I navigated to.

In iOS 6 view I navigate to is enclosed between navigation bar and footer. In iOS 7 it looks like sub-view is rendered full-screen, under navigation bar and footer. As result user don't see it.

Here is how I navigate to subview

BRSMyListSubViewController*tagsInfoVC =[[BRSMyListSubViewController alloc] initWithCheckinsList:self.checkinsList
                                                                                selectedTag:[self tagByIndexPath:indexPath]];[self.navigationController pushViewController:tagsInfoVC animated:YES];

Here is how I initialize it in viewDidLoad

self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStyleBordered target:self action:@selector(settings:)];

self.navigationItem.rightBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"Logout" style:UIBarButtonItemStyleBordered target:self action:@selector(logout:)];

For what it's worth I should also mention that sub-view is defined in XIB using Autolayout. Here is source of my XIB: http://pastebin.com/6RR0zYu4

And finally here is how it looks in iOS 6

enter image description here

And in iOS 7

enter image description here

Any thoughts ?

share | edit | flag
  add comment

1 Answer

up vote 5 down vote accepted

Well, I figured it out.

In your sub-view (BRSMyListSubViewController in my case), in viewDidLoad, you need to set one of these two

self.edgesForExtendedLayout =UIRectEdgeNone;
self.automaticallyAdjustsScrollViewInsets = NO;

OR

self.edgesForExtendedLayout =UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = YES;

Interestingly enough in root view controller these value are set to default UIRectEdgeAllNO andYES respectively but its tableView is NOT under navbar and footer.

I don't know why it's so illogical.

It's also strange that edgesForExtendedLayout has to be mixed with one of two other properties even though it's clearly responsible for the behavior.

share | edit | flag
 
upvote
  flag
Thank you for putting the answer, it really helped me. – titicaca Sep 12 at 6:11
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值