iOS7 下使用SVPullToRefresh 下拉刷新导航栏位置错误

iOS7 下使用SVPullToRefresh 下拉刷新导航栏位置错误;

下拉刷新之后,tableview的第一列会跑到导航栏的下面;

修正:添加如下代码

    /**
     *  下拉刷新 增加一个;
     */
    
    //修复下拉刷新位置错误 代码开始
    if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) {
        self.automaticallyAdjustsScrollViewInsets = NO;
        
        UIEdgeInsets insets = self.tableView.contentInset;
        insets.top = self.navigationController.navigationBar.bounds.size.height +
        [UIApplication sharedApplication].statusBarFrame.size.height;
        self.tableView.contentInset = insets;
        self.tableView.scrollIndicatorInsets = insets;
    }
    
    //修复下拉刷新位置错误  代码结束
    
    __block RootViewController *bSelf = self;
    
    [self.tableView addPullToRefreshWithActionHandler:^{
        
        [bSelf addRows];
    }];
    
    
    /**
     *  拉到最后 加载更多,增加一个;
     */
    [self.tableView addInfiniteScrollingWithActionHandler:^{
        [bSelf addMoreRow];
    }];

  

原文地址:https://www.cnblogs.com/cocoajin/p/3384049.html