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


3down votefavorite

 

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

And in iOS 7

Any thoughts ?

ios cocoa-touch ios6 uinavigationcontroller ios7


share|edit|flag

edited Aug 29 at 18:47

 

 

asked Aug 29 at 4:09

ruslan
3,42211555

  add comment

1 Answer

activeoldestvotes


up vote5down voteaccepted

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

edited Aug 29 at 6:11

 

 

answered Aug 29 at 5:29

ruslan
3,42211555

 

  upvote
  flag
Thank you for putting the answer, it really helped me. – titicaca Sep 12 at 6:11

欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 330987132 | Go:217696290 | Python:336880185 | 做人要厚道,转载请注明出处!http://www.cnblogs.com/sunshine-anycall/p/3338688.html

时间: 2024-05-01 14:53:27

ios7适配--navgationbar遮住下面view的处理的相关文章

按钮-IOS7适配问题,大神请进

问题描述 IOS7适配问题,大神请进 ios7中按钮有时候会延迟响应高亮状态,请问怎么取消这个东西,让它和ios6一样? 解决方案

ios7适配--uitableviewcell选中效果

ios7 UITableViewCell selectionStyle won't go back to blue up vote6down votefavorite 2 Xcode 5.0, iOS 7 and updating an existing app. UITableView selected row is now gray, not blue. From what I've read they changed the default selectionStyle to gray.

ios7适配--隐藏status bar

//viewDidload if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { // iOS 7 [self prefersStatusBarHidden]; [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; } else { // iOS 6 [[UIApplication sharedApplicati

iOS7 兼容适配 如何判断版本号

很多时候我们需要做不同版本的适配,所以首先要进行版本选择 方式一 <span class="line-number" style="color: inherit !important;">1</span> <span class="line-number" style="color: inherit !important;">2</span> <span class=&qu

iOS7第三方应用重设计的解决方案及案例参考

乍看上去,"为iOS7重设计"无非就是新的应用图标.无边框按钮.与导航栏配色相匹配的状态栏等等.不过如果你再深入挖掘一些,便会发现很多耀眼的地方都体现着iOS7的三大设计主题,即"依从.清晰.纵深". 对于某些应用来说,这些改变带来了设计上的极大改善,而另外一些则甚至比从前还要糟糕,不仅可用性被破坏,而且品牌识别效应也大打折扣.本文会围绕着iOS7 UI过渡指南当中提出的一些关键性的设计解决方案,介绍一些比较有代表性的应用案例.如果你正计划着升级自己的产品,或是以i

iOS10适配问题点总结_IOS

说在前面 iOS10和xcode8的GM版都放出了下载,我怀着忐忑的心更新了下(怕有适配问题啊!!!),先更新的xcode8,跑了下公司的项目,除了nullable字段有问题其他都还比较顺利,不过项目跑起来,还是有一点小问题,好在不像iOS9更新时变化那么多,然后我又给手机升级了iOS10,跑了个真机,结果一不小心测试到后半夜2点...浪费了一上午玩游戏的好时光.本篇就我碰到的问题一一整理,希望有类似问题的猴们,可以有点参考. 问题点 问题一(nullable) Q:以前是可以nullable的

[翻译] SWTableViewCell

SWTableViewCell An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application) 一个非常易用的 UITableViewCell 的子类,实现了左右滑动显示信息视图,提供很多实用的按钮(与iOS7的邮件应用相似)   Functionality Right

iOS 中导航栏的 hidesBottomBarWhenPushed 正确用法

iOS:hidesBottomBarWhenPushed的正确用法 OCT 12 今天说的是在TabBar嵌套Nav时,进行Push的时候隐藏TabBar的问题. 之前项目也需要这么做,那时候iOS7还没出,也是各种搜罗,后来的解决方法是当push操作的时候自己隐藏Tabbar,push过去视图拉伸适应屏幕,再pop回来的时候接再显示Tabbar,过程复杂还需要自己写动画,最终效果也不是很理想. 前两天公司APP上架,当时没有适配iOS7,在XCode4.6上开发编译并发布,居然在iOS7下跑起

iOS开发-常用第三方开源框架介绍(你了解的ios只是冰山一角)

图像: 1.图片浏览控件MWPhotoBrowser        实现了一个照片浏览器类似 iOS 自带的相册应用,可显示来自手机的图片或者是网络图片,可自动从网络下载图片并进行缓存.可对图片进行缩放等操作.       下载:https://github.com/mwaterfall/MWPhotoBrowser   目前比较活跃的社区仍旧是Github,除此以外也有一些不错的库散落在Google Code.SourceForge等地方.由于Github社区太过主流,这里主要介绍一下Gith