开发者

TableView scrolls to bottom and perform some action

开发者 https://www.devze.com 2023-03-10 18:31 出处:网络
In my application there is a table view.What I want to do is when I scrolls the table view and when it come to its end row I want to perform some action.

In my application there is a table view.What I want to do is when I scrolls the table view and when it come to its end row I want to perform some action. Please tell me which approach should I use to do this. T开发者_C百科hanks in advance!!


I think you should make a check in

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)

when it loads the last row then call that method.

I think this will work. because table does not load all data at once but i loads data when user scroll


I think (don't the docs up here) but there is no method within the UIScrollViewDelegate that handles the scrolling to the bottom. There is when scrolling to top, but can't remember if there is scrolling to bottom. Check it please.

If not, the easy way is just to check the indexpath.row at cellForRow. If it is your last row, call whatever action you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消