3

i tested my App on iOS 7 and recognize that my "Pull to Refresh" (ODRefreshControl https://github.com/Sephiroth87/ODRefreshControl) doesn´t work anymore.

I have to pull the scrollview extremly far down to see a small part of the spinner and the arrow icon. What could be the Problem. On iOS 5 and iOS 6 it works perfectley!!

Davis
  • 1,253
  • 4
  • 17
  • 38
  • 1
    Hey, came across the same issue not long ago. Looking through the implementation I just noticed the frame property was calculated manually. So it was actually a 4-inch display issue in my case and I fixed it with y-adjustment. – Paul E. Sep 18 '13 at 14:12
  • Hey thanks for the tip, i solved the Problem at a similar way. The Problem in my case was the Status and the Navi Bar in iOS 7. I also changed the y-adjustment :) – Davis Sep 20 '13 at 12:01
  • do you have a sample code that shows where you fixed it ? – Skovie Nov 12 '13 at 22:01

1 Answers1

5

I added only one Value in ODRefreshControl.m to fix the Issue for iOS7. Maybe the value is a little bit different from app to app!

BEFORE:

- (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;
}

AFTER:

- (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;
}
Davis
  • 1,253
  • 4
  • 17
  • 38