ios - 如何在 ios 中下拉 TableView 时隐藏 UINavigationbar?

标签 ios objective-c uitableview uinavigationbar

我有一个 UIViewController 对象,里面有一个 UITableView 对象。我想在下拉 UITableViewCell 时隐藏 UINavigationbar,在上拉 UITableViewCell 时显示 UINavigationbar。我应该怎么办?谢谢。

最佳答案

感谢 dimimpou 和 Wain。 现在我像这样使用你的想法:

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
    if (velocity.y > 0)
    {
        [self.navigationController setNavigationBarHidden:YES animated:YES];
    }
    else
    {
        [self.navigationController setNavigationBarHidden:NO animated:YES];
    }
}

关于ios - 如何在 ios 中下拉 TableView 时隐藏 UINavigationbar?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22008298/

相关文章:

ios - 网页内容在 UIWebView 中被截断

ios: UIScrollView scrollRectToVisible 不工作

ios:UITableVIewCell 扩展未按预期工作

objective-c - insertRowsAtIndexPaths 后 UITableViewCell 为零

ios - 如何在不安装 Fabric.app 的情况下在 iOS 上使用 Twitter 的框架?

ios - `ExpressibleByArrayLiteral`符合类及其父类(super class)=> “<superclass> is not convertible to <subclass>”

objective-c - 使用 tabbarViewController.selectedViewContreller 没有推送下一个 View

objective-c - 使用 NSInferMappingModelAutomaticallyOption 更改核心数据中的属性类型

ios - 什么叫setSelected :NO method automatically

iphone - respondsToSelector 总是失败