iPhone : HOWTO move status bar with pan gesture

后端 未结 4 1472
不思量自难忘°
不思量自难忘° 2020-12-28 09:21

Like Instagram - EXPLORE Tab, when I scroll the content, the status bar moves as well.

Always called FullScreenScroll, like here, when the user scro

4条回答
  •  生来不讨喜
    2020-12-28 10:10

    I don't know why downvote my question without comments or reasons. Though, I found a solution to achieve moving status bar.

    Thanks to this question and answer which I upvoted for, I can change the statusBar's frame while scrolling like below:

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView
    {
        NSArray *windows = [[UIApplication sharedApplication] FEX_windows];
        for (UIWindow *window in windows) {
            if ([window isKindOfClass:NSClassFromString(@"UIStatusBarWindow")]) {
                CGRect frame = window.frame;
                frame.origin.y -= 5;
                window.frame = frame;
            }
        }
    }
    

提交回复
热议问题