mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 01:31:02 +00:00
Add content inset bottom to maintain position
This commit is contained in:
parent
fa1487df16
commit
c7e4186749
1 changed files with 7 additions and 0 deletions
|
@ -272,6 +272,13 @@ private extension TableViewController {
|
||||||
if
|
if
|
||||||
let item = update.maintainScrollPosition,
|
let item = update.maintainScrollPosition,
|
||||||
let indexPath = self.dataSource.indexPath(for: item) {
|
let indexPath = self.dataSource.indexPath(for: item) {
|
||||||
|
self.tableView.contentInset.bottom = max(
|
||||||
|
0,
|
||||||
|
self.tableView.frame.height
|
||||||
|
- self.tableView.contentSize.height
|
||||||
|
- self.tableView.safeAreaInsets.top
|
||||||
|
- self.tableView.safeAreaInsets.bottom)
|
||||||
|
+ self.tableView.rectForRow(at: indexPath).minY
|
||||||
self.tableView.scrollToRow(at: indexPath, at: .top, animated: false)
|
self.tableView.scrollToRow(at: indexPath, at: .top, animated: false)
|
||||||
|
|
||||||
if let offsetFromNavigationBar = offsetFromNavigationBar {
|
if let offsetFromNavigationBar = offsetFromNavigationBar {
|
||||||
|
|
Loading…
Reference in a new issue