3
您可以請共享代碼片段或指引我到Xamarin文檔,如何實現UITableView,滾動以加載更多功能。Xamarin iOS,UITableView,滾動以加載更多
如何檢測tableview是否滾動到底部?
在此先感謝!
您可以請共享代碼片段或指引我到Xamarin文檔,如何實現UITableView,滾動以加載更多功能。Xamarin iOS,UITableView,滾動以加載更多
如何檢測tableview是否滾動到底部?
在此先感謝!
的TableViewSource類覆蓋內部此方法
public override void WillDisplay (UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
{
if (indexPath.Row == tableItems.Count - 1) {
//Reload your data here
}
}
構造TableViewSource類
isScrolling = false;
的TableViewSource類覆蓋內部此方法
public override void Scrolled (UIScrollView scrollView)
{
// load more bottom
float height = scrollView.Frame.Size.Height;
float distanceFromBottom = scrollView.ContentSize.Height - scrollView.ContentOffset.Y;
if(distanceFromBottom < height && isScrolling == false)
{
// reload data here
}
}