UIViewController:UITableView和UIToolbar之间的空白区域

时间:2015-11-09 16:21:39

标签: xcode swift uitableview scrollbar uitoolbar

我有UIViewController(包含在UINavigationController中)UITableViewUIToolbar。现在当我滚动我的视图时,tableView的末尾和工具栏之间总是有一个空白区域(图中标记为红色)。滚动条此时也会停止。

我试图在故事板中取消选中Adjust Scroll View Insets,但我的tableView顶部不适合视图。

任何人都可以帮我解决这个问题吗?

enter image description here

编辑:

我正在使用Auto Layout,我的viewController的storyboard配置如下所示。在之前的viewController中,我使用UITabBarUINavigationController

enter image description here

1 个答案:

答案 0 :(得分:0)

I've found a workaround for that problem:

override func viewDidLoad() {
   super.viewDidLoad()    
   tableView.contentInset = UIEdgeInsetsMake(0, 0, -50, 0)
   tableView.scrollIndicatorInsets = tableView.contentInset
}