1.如果请求的行数比较少,需要判断请求出来的数据是不是少于X行,若是,去掉MJRefresh的底部文字
if (<span style="font-size:18px;color:#FF0000;"><strong>xxxxxArray</strong></span>.count < 10) {
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
footer.stateLabel.text = @"";
self.tableView.footer = footer;
} else {
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
footer.stateLabel.text = @"点击或上拉加载更多";
self.tableView.footer = footer;
}2.去掉tableView中多余的行数
self.tableView.tableFooterView = [[UIView alloc] init];3.tableView点击后去掉点击效果,或者直接不设置
cell.selectionStyle = UITableViewCellSelectionStyleNone;
本文介绍了iOS开发中UITableView的优化方法,包括如何处理少量数据时移除底部刷新提示、如何去除多余行数以及如何取消单元格点击效果,旨在提高用户体验。
2735

被折叠的 条评论
为什么被折叠?



