mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
iOS: #1186 (full screen controls hide with traversal)
Fixed nav bar appearing and disappearing when scrolling on older iPhones.
This commit is contained in:
parent
7d79486ce2
commit
2c11901d67
1 changed files with 10 additions and 2 deletions
|
@ -1344,8 +1344,16 @@
|
|||
int viewportHeight = self.view.frame.size.height;
|
||||
int topPosition = self.webView.scrollView.contentOffset.y;
|
||||
int safeBottomMargin = 0;
|
||||
int minimumTopPositionWhenHidden = -1;
|
||||
|
||||
if (@available(iOS 11.0, *)) {
|
||||
safeBottomMargin = -1 * appDelegate.storyPageControl.view.safeAreaInsets.bottom/2;
|
||||
CGFloat bottomInset = appDelegate.storyPageControl.view.safeAreaInsets.bottom;
|
||||
|
||||
safeBottomMargin = -1 * bottomInset / 2;
|
||||
|
||||
if (bottomInset != 0) {
|
||||
minimumTopPositionWhenHidden = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int bottomPosition = webpageHeight - topPosition - viewportHeight;
|
||||
|
@ -1363,7 +1371,7 @@
|
|||
|
||||
if (!isHorizontal && appDelegate.storyPageControl.previousPage.pageIndex < 0) {
|
||||
[appDelegate.storyPageControl setNavigationBarHidden:NO];
|
||||
} else if (isHorizontal && topPosition <= 0 && isNavBarHidden) {
|
||||
} else if (isHorizontal && topPosition <= minimumTopPositionWhenHidden && isNavBarHidden) {
|
||||
[appDelegate.storyPageControl setNavigationBarHidden:NO];
|
||||
} else if (!nearTop && !isNavBarHidden && self.canHideNavigationBar) {
|
||||
[appDelegate.storyPageControl setNavigationBarHidden:YES];
|
||||
|
|
Loading…
Add table
Reference in a new issue