Closed Rep2 closed 7 years ago
Does this StackOverflow post explain this issue that you're seeing? http://stackoverflow.com/a/23664755
It describes the problem and uses (IMO hacky) solution tableView.contentInset = UIEdgeInsets(top: -35, left: 0, bottom: 0, right: 0)
.
I followed this post http://stackoverflow.com/questions/21069258/automaticallyadjustsscrollviewinsets-not-working and tried all solutions. Non except tableView.contentInset = UIEdgeInsets(top: -35, left: 0, bottom: 0, right: 0)
work.
Is your table view inside a view controller like that post described? If so, can you try following the steps they outlined for that situation?
Yes. I have tried setting it both as base view and adding it as a subview to the base view. Same behaviour on both cases.
I am not sure that LayoutKit is causing the problem, but it seems weird to me that manually setting the header view height to CGFloat.leastNonzeroMagnitude
fixes the issue.
I found a weird behaviour when using ReloadableViewLayoutAdapter with UITableView.
I am unable to remove
tableView.topInset = 35
. I think I have tried everything. SettingautomaticallyAdjustsScrollViewInsets = false
on all VCs in hierarchy and settingtableView.sectionHeaderHeight = 0, tableView.sectionFooterHeight = 0
.It is possible to set
tableView.contentInset = UIEdgeInsets(top: -35, left: 0, bottom: 0, right: 0)
but it seems too hacky.The only thing that fixes this is changing
to
in
extension ReloadableViewLayoutAdapter: UITableViewDelegate
.Setting header height to 0 results in it using default headerHeight value. Even though I have set
tableView.sectionHeaderHeight = 0
it still adds topInset. Am I missing something?I do not think default implementation should be
CGFloat.leastNonzeroMagnitude
. Better solution IMO would be to make method open.