UIViewController:UITableView 和 UIToolbar 之间的白色 space
UIViewController: White space between UITableView and UIToolbar
我有一个 UIViewController
(包含在 UINavigationController
中)、一个 UITableView
和一个 UIToolbar
。现在当我滚动我的视图时,在 tableView 的末端和工具栏之间总是有一个白色的 space(图中标记为红色)。滚动条也在此时停止。
我尝试取消选中 Storyboard 中的 Adjust Scroll View Insets
,但是我的 tableView 的顶部不适合该视图。
有人可以帮我解决这个问题吗?
编辑:
我正在使用 Auto Layout
,viewController 的故事板配置如下所示。在之前的 viewController 中,我使用 UITabBar
到 UINavigationController
。
我找到了解决该问题的方法:
override func viewDidLoad() {
super.viewDidLoad()
tableView.contentInset = UIEdgeInsetsMake(0, 0, -50, 0)
tableView.scrollIndicatorInsets = tableView.contentInset
}
我有一个 UIViewController
(包含在 UINavigationController
中)、一个 UITableView
和一个 UIToolbar
。现在当我滚动我的视图时,在 tableView 的末端和工具栏之间总是有一个白色的 space(图中标记为红色)。滚动条也在此时停止。
我尝试取消选中 Storyboard 中的 Adjust Scroll View Insets
,但是我的 tableView 的顶部不适合该视图。
有人可以帮我解决这个问题吗?
编辑:
我正在使用 Auto Layout
,viewController 的故事板配置如下所示。在之前的 viewController 中,我使用 UITabBar
到 UINavigationController
。
我找到了解决该问题的方法:
override func viewDidLoad() {
super.viewDidLoad()
tableView.contentInset = UIEdgeInsetsMake(0, 0, -50, 0)
tableView.scrollIndicatorInsets = tableView.contentInset
}