3

我在 iOS 7 上测试了我的应用程序,发现我的“拉动刷新”(ODRefreshControl https://github.com/Sephiroth87/ODRefreshControl)不再起作用。

我必须将滚动视图拉得很远才能看到微调器和箭头图标的一小部分。可能是什么问题呢。在 iOS 5 和 iOS 6 上完美运行!!

4

1 回答 1

5

我在 ODRefreshControl.m 中只添加了一个值解决 iOS7 的问题。也许应用程序之间的价值有点不同!

前:

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if ([keyPath isEqualToString:@"contentInset"]) 
{
    if (!_ignoreInset) 
{
        self.originalContentInset = [[change objectForKey:@"new"] UIEdgeInsetsValue];
        self.frame = CGRectMake(0, -(kTotalViewHeight + self.scrollView.contentInset.top), self.scrollView.frame.size.width, kTotalViewHeight);
    }
    return;
}

后:

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:     (NSDictionary *)change context:(void *)context
{

NSInteger iOS7Value = 60.0f;

if ([keyPath isEqualToString:@"contentInset"]) 
{
    if (!_ignoreInset) 
{
        self.originalContentInset = [[change objectForKey:@"new"] UIEdgeInsetsValue];

        if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
{

        self.frame = CGRectMake(0, -(kTotalViewHeight + self.scrollView.contentInset.top) + iOS7Value, self.scrollView.frame.size.width, kTotalViewHeight);

        } else {

            self.frame = CGRectMake(0, -(kTotalViewHeight + self.scrollView.contentInset.top), self.scrollView.frame.size.width, kTotalViewHeight);
        }
    }
    return;
}
于 2013-11-13T10:11:51.977 回答