Xamarin iOS, UITableView, Scroll to load more

后端 未结 2 1870
孤城傲影
孤城傲影 2021-01-14 01:56

Can you please share code snippets or direct me to the xamarin docs, how to implement UITableView, scroll to load more functionality.

How to detect if the tableview

2条回答
  •  有刺的猬
    2021-01-14 02:39

    constructor TableViewSource class

    isScrolling = false;
    

    inside the TableViewSource class override this method

    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
            }
        }
    

提交回复
热议问题