Section Headers in UITableView when inset of tableview is changed

前端 未结 4 2018
刺人心
刺人心 2021-02-01 07:18

I have implemented a \"Pull to refresh\" in my tableView like the iPhone app Twitter or Facebook.
My tableView has sections with head views. When the tableView is in \"Refre

4条回答
  •  星月不相逢
    2021-02-01 07:42

    I had the same problem when using contentInset and fixed it by adding code to scrollViewDidScroll: to update the contentInset dynamically while in the "loading" state.

    if( refreshState == kLoading ) {
        if( scrollView.contentOffset.y >= 0 )
            scrollView.contentInset = UIEdgeInsetsZero;
        else
            scrollView.contentInset = UIEdgeInsetsMake( MIN( -scrollView.contentOffset.y, kPullHeight ), 0, 0, 0 );
    }       
    

提交回复
热议问题