在 UITabBarController 和 UINavigationController tableView被navigati
来源:互联网 发布:统计学数据分析报告 编辑:程序博客网 时间:2024/05/18 16:55
问题描述:
当一个navigation导航进入到UITabBarController TabBar里面有多个页面,页面下有tableView,当我进入Tableview的时候,上面两行table给挡住了,当我点击进去返回回来又没有可以看得见了,发现table向上的是44PT刚好是一个top bar 的位置。(但是从这个页面的父页面push到这个页面还是被挡住了,但是我从这个页面的子页面pop出来又不会被挡住)如下图:
在 - ( void )viewDidLoad {
加入以下代码可解决这个问题
- (void)viewDidLoad {
[super viewDidLoad];
//self.automaticallyAdjustsScrollViewInsets = NO;
self.edgesForExtendedLayout = UIRectEdgeNone;
在iOS 7中,苹果引入了一个新的属性,叫做[UIViewController setEdgesForExtendedLayout:]
,它的默认值为UIRectEdgeAll
。当你的容器是navigation controller时,默认的布局将从navigation bar的顶部开始。这就是为什么所有的UI元素都往上漂移了44pt。
This property is only applied to view controllers that are embedded in containers, such as UINavigationController or UITabBarController. View controllers set as the root view controller do not react to this property. Default value is UIRectEdgeAll.
感觉上这个坑对于自学的人来说有点难处理在开始的时候。
0 0
- 在 UITabBarController 和 UINavigationController tableView被navigati
- 在 UITabBarController 和 UINavigationController tableView被navigati
- UINavigationController和UITabBarController合用。
- UINavigationController和UITabBarController合用
- UINavigationController和UITabBarController合用。
- 隐藏UINavigationController和UITabBarController
- UITabBarController和UINavigationController混用
- UINavigationController和UITabBarController合用。
- UINavigationController和UITabBarController
- UINavigationController和UITabBarController混用
- tabbar在UITabbarController和UINavigationController中的显示,隐藏问题
- UItabBarController和UINavigationController结合使用
- UINavigationController和UITabBarController的集成
- UITabBarController 和 UINavigationController 的 popToRootViewController
- iOS 自定义UINavigationController和UITabBarController
- UINavigationController和UITabbarController内部结构解析
- UITabBarController和UINavigationController搭配使用
- UINavigationController跳转到UITabBarController和UITabBarController跳转到 UINavigationController
- Redis教程(一):Redis简介
- 完美解决failed to open stream: HTTP request failed!(file_get_contents引起的)
- Swiper 简单使用
- Redis教程(二):String数据类型
- Redis教程(三):List数据类型
- 在 UITabBarController 和 UINavigationController tableView被navigati
- 一个简单的音频播放脚本
- Redis教程(四):Hashes数据类型
- 在windows服务器上都正常,但放到一台linux服务器上session变量却不能传递
- Android之WebView
- 事务的嵌套
- Redis教程(五):Set数据类型
- Android Activity内镶嵌Activity
- 链接中存在中文的处理办法