【发布时间】:2013-12-03 04:46:56
【问题描述】:
我有一个由 REST Web 服务填充的 UITableview。我启用了弹跳,以便我可以使用
触发对服务器的调用- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
使用此方法,当用户在尝试滚动到 tableView 底部后抬起手指时,调用会被触发。然后视图反弹回来并添加新的单元格。我遇到的问题是添加任何内容并不明显。 tableView 弹回屏幕底部,直到用户再次尝试滚动新单元格才可见。这是我用来触发呼叫的方法。
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
NSInteger currentOffset = scrollView.contentOffset.y;
NSInteger maximumOffset = scrollView.contentSize.height - scrollView.frame.size.height;
if (maximumOffset - currentOffset <= -40)
{
if (scrollView == _feedTableView)
{
//This method has a call to the server and adds the new cells to the table
[self loadFeed:feedRefreshControl];
}
}
}
我尝试关闭触发后的弹跳,以试图让底部单元格保持在用户抬起手指时的位置,但最后一个单元格只是以非动画方式弹回底部。
任何想法都将不胜感激!
【问题讨论】:
标签: ios uitableview uiscrollview bounce