在Uitableview滚动上加载数据 [英] Load Data On Uitableview scroll
本文介绍了在Uitableview滚动上加载数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有2000条记录,我必须在 UITableView
中只显示15条记录,当用户滚动 UITableView
时,更多在表格中加载15条记录。我应该怎么做?
I have 2000 records and i have to display only 15 records in UITableView
, When User Scroll UITableView
, More 15 records shold be load in table. How should I do it?
推荐答案
我认为答案是: - (void)scrollViewDidScroll :( UIScrollView *)scrollView
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGPoint offset = scrollView.contentOffset;
CGRect bounds = scrollView.bounds;
CGSize size = scrollView.contentSize;
UIEdgeInsets inset = scrollView.contentInset;
float y = offset.y + bounds.size.height - inset.bottom;
float h = size.height;
float reload_distance = 15;
if(y > h + reload_distance)
{
//Call the Method to load More Data...
}
}
希望它会有所帮助...... !!!
Hope it will be helpful...!!!
这篇关于在Uitableview滚动上加载数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文