How do I programmatically slide the UITableView down to reveal the underlying UIRefreshControl

后端 未结 4 1861
天涯浪人
天涯浪人 2021-02-04 01:06

How can I reveal the UIRefreshControl when I update the table programmatically? Using [self.refreshControl beginRefreshing] make the spinner animate but does not reveal it.

4条回答
  •  悲哀的现实
    2021-02-04 01:33

    You'll have to manually change the contentOffset of your UITableView yourself. Be sure to account for the contentInset.top. It should be something as simple as:

    CGPoint newOffset = CGPointMake(0, -[myTableView contentInset].top);
    [myTableView setContentOffset:newOffset animated:YES];
    

提交回复
热议问题