Search code examples
xcodeswiftuitableviewscrollbaruitoolbar

UIViewController: White space between UITableView and UIToolbar


I have a UIViewController (included in a UINavigationController) with a UITableView and a UIToolbar. Now when I'm scrolling my view, there is always a white space (marked red in the picture) between the end of the tableView and the toolbar. Also the scrollbar stops at this point.

I've tried to uncheck Adjust Scroll View Insets in storyboard, but then the top of my tableView doesn't fit on the view.

Cann anybody help me to fix that issue?

enter image description here

EDIT:

I'm using Auto Layout and my storyboard configuration for the viewController looks like the following. In the previous viewController I'm using a UITabBar through a UINavigationController.

enter image description here


Solution

  • I've found a workaround for that problem:

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