forked from shadowfacts/Tusker
Actually fix multi-column nav scrolling animations this time (hopefully)
Closes #539
This commit is contained in:
parent
f9c0506590
commit
506d2ad8a9
|
@ -152,10 +152,10 @@ class MultiColumnNavigationController: UIViewController {
|
|||
let column = stackView.arrangedSubviews[columnIndex]
|
||||
let columnFrame = column.convert(column.bounds, to: scrollView)
|
||||
let offset: CGFloat
|
||||
if columnFrame.maxX < scrollView.bounds.width - scrollView.adjustedTrailingContentInset {
|
||||
if columnFrame.maxX <= view.bounds.width - view.safeAreaInsets.left - view.safeAreaInsets.right - scrollView.adjustedTrailingContentInset {
|
||||
offset = -scrollView.adjustedLeadingContentInset
|
||||
} else {
|
||||
offset = scrollView.contentSize.width - scrollView.bounds.width + scrollView.adjustedTrailingContentInset
|
||||
offset = columnFrame.maxX - scrollView.bounds.width + scrollView.adjustedTrailingContentInset
|
||||
}
|
||||
scrollView.setContentOffset(CGPoint(x: offset, y: -scrollView.adjustedContentInset.top), animated: animated)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue