使得“负载更多”按钮在uitableviewcell? [英] making a "load more" button in uitableviewcell?

查看:115
本文介绍了使得“负载更多”按钮在uitableviewcell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hey,
任何一个指导我通过这我有大约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?

推荐答案

在表格中显示额外的一行

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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆