iOS 7中的Pull To Refresh [英] Pull To Refresh in iOS 7

查看:79
本文介绍了iOS 7中的Pull To Refresh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在我的表格视图中在iOS 7上正确使用拉动刷新功能。在viewDidLoad上,我有:

I'm trying to get the pull to refresh feature working properly on iOS 7 in my Table View. On viewDidLoad, I have:

self.refreshControl = [[UIRefreshControl alloc] init];

    [self.refreshControl addTarget:self action:@selector(refreshInvoked:forState:) forControlEvents:UIControlEventValueChanged];

然后我运行:

-(void) refreshInvoked:(id)sender forState:(UIControlState)state {
    // Refresh table here...
    [_allEntries removeAllObjects];
    [self.tableView reloadData];
    [self refresh];
}

当刷新方法调用的请求完成后,在didCompleteRequest代码中,我有:

When the request that the refresh method invokes is done, in the didCompleteRequest code, I have:

[self.refreshControl endRefreshing];

在iOS 6上,这意味着当你向下拉表格视图时,它会显示当你拉动时,它会伸展开来的圆形箭头,在拉得足够远之后,它会刷新。但是现在,我看不到圆形箭头,只是一个UIActivityIndi​​cator。它有时也会起作用,有时也不起作用。我缺少什么?

On iOS 6, this would mean that as you pull down on the table view, it would show the circular arrow that would get stretched out as you pull, and after pulled far enough, it would refresh. Right now, though, I see no circular arrow, just a UIActivityIndicator. It also sometimes will work and sometimes will not. What am I missing?

推荐答案

您正在谈论的'UIActivityIndi​​cator'是UIRefreshControl的新默认外观。

The 'UIActivityIndicator' that you are talking about is the new default appearance of a UIRefreshControl.

你拉下来,随着圆圈的完成,它显示了你触发刷新的接近程度。

You pull down and as the circle completes it is showing how close to triggering a refresh you are.

这篇关于iOS 7中的Pull To Refresh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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