Tab Bar涵盖iOS7中的TableView单元格 [英] Tab Bar covers TableView cells in iOS7

查看:103
本文介绍了Tab Bar涵盖iOS7中的TableView单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义的tableViewController,我将其添加到TabBarController中

I have a custom tableViewController that I'm adding to a TabBarController with

self.tabBarController.viewControllers = [NSArray arrayWithObjects:someOtherViewController, customTableViewController, nil];
self.tabBarController.selectedIndex = 1;

我遇到的问题是最后1.5个tableViewCells被标签栏覆盖了在运行iOS7的iPhone 4上的屏幕底部。当我使用iOS模拟器 - iPhone Retina(4英寸)/ iOS 7.0时,这个问题仍然存在。

The issue I'm having is that the last 1.5 tableViewCells are being covered by the tab bar at the bottom of the screen on an iPhone 4 running iOS7. When I use the iOS Simulator - iPhone Retina (4-inch) / iOS 7.0 the issue still exists.

使tableView排队的正确方法是什么屏幕底部的tabBar顶部没有使用'幻数'?

What is the correct way to make the tableView line up with the top of the tabBar at the bottom of the screen without using 'magic numbers'?

推荐答案

试试这个你的CustomViewController:

Try this for your CustomViewController:

- (void)viewDidLoad
{
    [super viewDidLoad];

    UIEdgeInsets adjustForTabbarInsets = UIEdgeInsetsMake(0, 0, CGRectGetHeight(self.tabBarController.tabBar.frame), 0);
    self.scrollView.contentInset = adjustForTabbarInsets;
    self.scrollView.scrollIndicatorInsets = adjustForTabbarInsets;
}

这篇关于Tab Bar涵盖iOS7中的TableView单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆