简体   繁体   English

在iPhone中隐藏像Instagram或Facebook这样的导航栏?

[英]hiding the navigation bar like instagram or Facebook in iPhone?

I had an application in which I want to hide my navigation bar when scrolling upwards in a UITableView . 我有一个应用程序,我想在UITableView向上滚动时隐藏我的导航栏。 I am doing like this 我这样做

- (void)scrollViewDidScroll:(UIScrollView *)sender {

    //Initializing the views and the new frame sizes.
    UINavigationBar *navbar = self.navigationController.navigationBar;
    UIView *tableView = self.view;

    CGRect navBarFrame = self.navigationController.navigationBar.frame;
    CGRect tableFrame = self.view.frame;

    //changing the origin.y based on the current scroll view.
    //Adding +20 for the Status Bar since the offset is tied into that.
    navBarFrame.origin.y = MIN(0, (sender.contentOffset.y * -1)) +20;
    navbar.frame = navBarFrame;

    tableFrame.origin.y = MIN(0,MAX(-44,(sender.contentOffset.y * -1)));
    tableView.frame = tableFrame;    
}

But the problem is that it is moving completely upwards in iOS 7. I need it to be stopped under the status bar and the status bar is shown there. 但问题是它在iOS 7中完全向上移动。我需要在状态栏下停止它并在那里显示状态栏。

https://github.com/ninjinkun/NJKScrollFullScreen ...希望这会对任何其他人有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM