问题描述
嘿,谁能指导我完成这个我在表中有大约 15 个条目我希望另外 15 个条目在最后一个 UITableViewCell 中提供更多负载.谁能帮帮我?
hey, Could any one guide me through this I have around 15 entries in table I would like another 15 to come up with the load more in last UITableViewCell. could anyone help me?
推荐答案
在tableview中显示一个额外的行,在
to show an extra row in the tableview, in
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return dataRows+1;
}
在
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
//after setting tableviewcell
if(indexPath.row==dataRows){
cell.textLabel.text=@"Load More Rows";
}
}
在
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row==dataRows){
//there you can write code to get next rows
}
}
您需要根据显示的行更新 numberOfRows 变量.
You need to update the numberOfRows variable according to the displayed rows.
获取额外条目后,您可以使用以下方法将它们添加到现有条目数组中.您的原始数组应该是 NSMutableArray 才能使用此方法.
After fetching the extra entries, you can add them to the existing entries array using the following method. Your original array should be a NSMutableArray to use this method.
[originalEntriesArray addObjectsFromArray:extraEntriesArray];
这篇关于制作“加载更多"uitableviewcell 中的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)