iPhone:HOWTO用平移手势移动状态栏 [英] iPhone : HOWTO move status bar with pan gesture

查看:177
本文介绍了iPhone:HOWTO用平移手势移动状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与Instagram一样 - 探索标签,当我滚动内容时,状态栏也会移动。

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

始终称为 FullScreenScroll ,如< a href =https://github.com/inamiy/YIFullScreenScroll>这里,当用户滚动tableView时,NavigationBar&滚动TabBar同时显示或隐藏。

Always called FullScreenScroll, like here, when the user scrolls the tableView, the NavigationBar & TabBar are scrolled to show or hide at the same time.

我的问题是,不仅仅是NavigationBar& TabBar,我也想让StatusBar跟随手指移动。

My problem is, not only NavigationBar & TabBar, I also want to make the StatusBar follow the finger move.

最后,它真的是全屏。

推荐答案

我不知道知道为什么没有评论或理由就投票我的问题。虽然,我找到了一个实现移动状态栏的解决方案。

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

感谢问题和我提出的答案,我可以在滚动时改变statusBar的框架:

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;
        }
    }
}

这篇关于iPhone:HOWTO用平移手势移动状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆