taiyang2014

点击导航栏tableView回到顶部

  UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(returnTop)];
     self.navigationItem.titleView.userInteractionEnabled = YES;
    [self.navigationController.navigationBar addGestureRecognizer:tap];
 
#pragma mark - 回到顶部
- (void)returnTop {
     [self.tableView setContentOffset:CGPointMake(0, - 44) animated:YES];
}

posted on 2015-12-04 17:15  taiyang2014  阅读(258)  评论(0编辑  收藏  举报

导航