ios tableView 加载完成跳到最后一行

自定义UITableView,添加属性isLoadTableView

@property (nonatomic) BOOL isLoadTableView;

添加代理方法 (在代理方法加载最后一行后,跳到最后一行)

- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

    if (indexPath.row == [self numberOfRowsInSection:0]-1 && !self.isLoadTableView) {

        self.isBackTableView = YES;
        
        [self scrollToRowAtIndexPath:indexPathatScrollPosition:UITableViewScrollPositionBottom animated:NO];

    }
    
}


发布了31 篇原创文章 · 获赞 30 · 访问量 7377

猜你喜欢

转载自blog.csdn.net/qq_41586150/article/details/104350824
今日推荐