2

SubViewController (a child of ViewController and IndicatorInfoProvider) is added using MainViewController (a child of ButtonBarPagerTabStripViewController) with NavigationBar added.

Padding does not occur even if you tap tabbutton, padding occurs on top when swipe.

animated gif

https://i.stack.imgur.com/VRLg7.gif

override func viewDidLoad() {
    super.viewDidLoad()
    print("viewDidLoad")
    // Do any additional setup after loading the view.
    self.view.backgroundColor = UIColor.clear

    //tableview
    self.tableView.delegate = self
    self.tableView.dataSource = self
    self.tableView.backgroundView = nil
    self.tableView.backgroundColor = UIColor.clear

    //動的に高さを変更
    self.tableView.estimatedRowHeight = 155
    self.tableView.rowHeight = UITableViewAutomaticDimension

    //indicator
    self.tableView.showIndicator()

    //loaddata
    loadData(page:0)

}
Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92
Tagorimo
  • 21
  • 4

2 Answers2

2

I've encountered the same problem. Open your storyboard and select the MainViewController. In the Attribute Inspector deselect the checkbox 'Adjust scroll view insets'

filograno
  • 21
  • 3
0

Are you using a UITableViewController as a childViewController? This issue seems to happen in this case.

To fix this, you should be setting automaticallyAdjustsScrollViewInsets = false and also having as childViewControllers only UIViewControllers with a UITableView inside, instead of UITableViewController.

Cheers

Federico Ojeda
  • 758
  • 7
  • 11