如何以编程方式向下滑动UITableView以显示底层的UIRefreshControl [英] How do I programmatically slide the UITableView down to reveal the underlying UIRefreshControl

查看:121
本文介绍了如何以编程方式向下滑动UITableView以显示底层的UIRefreshControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我以编程方式更新表时,如何显示UIRefreshControl?
使用[self.refreshControl beginRefreshing]使微调器有效,但不会显示它。

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.

推荐答案

你将拥有手动更改 UITableView contentOffset 。请务必考虑 contentInset.top 。它应该是一样简单:

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];

这篇关于如何以编程方式向下滑动UITableView以显示底层的UIRefreshControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆