我里面有一个 tableView -> navigationViewController -> tabBarController。
无论我做什么,tableView 都会在状态栏下不断滚动。我喜欢它停在状态栏下方。
所有 viewController 均按标准方式配置。我以多种不同的方式配置它们并尝试了多种组合。
无论我做什么,tableView 都会在状态栏下方滚动。
我觉得不需要在代码中配置它,但我只是调整 contentInset 和scrollIndicatorInset 没有成功。
tableView.scrollIndicatorInsets = UIEdgeInsets(top: 20.0, left: 0.0, bottom: 0.0, right: 0.0)
tableView.contentInset = UIEdgeInsets(top: 20.0, left: 0.0, bottom: 0.0, right: 0.0)
调整只是将 tableView 再向下推 20px。
这是当前tableView的大小。为了清晰起见,我将背景设为橙色。