Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions PullToRefreshView.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (id)initWithScrollView:(UIScrollView *)scroll {
subtitleLabel.textAlignment = UITextAlignmentCenter;
[self addSubview:subtitleLabel];

statusLabel = [[UILabel alloc] init];
statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, frame.size.height - 48.0f, self.frame.size.width, 20.0f)];
statusLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
statusLabel.font = [UIFont systemFontOfSize:12.f];
statusLabel.textColor = kPullToRefreshViewTitleColor;
Expand All @@ -108,6 +108,8 @@ - (id)initWithScrollView:(UIScrollView *)scroll {
#endif

[self.layer addSublayer:arrowImage];

[self setState:kPullToRefreshViewStateNormal];
}

return self;
Expand Down Expand Up @@ -167,6 +169,8 @@ - (void)setState:(PullToRefreshViewState)state_ {
[self showActivity:YES animated:YES];
[self setImageFlipped:NO];
scrollView.contentInset = UIEdgeInsetsMake(fminf(-scrollView.contentOffset.y, -kPullToRefreshViewTriggerOffset), 0, 0, 0);
if ([delegate respondsToSelector:@selector(pullToRefreshViewShouldRefresh:)])
[delegate pullToRefreshViewShouldRefresh:self];
break;
default:
break;
Expand Down Expand Up @@ -213,9 +217,6 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
[UIView setAnimationDuration:kPullToRefreshViewAnimationDuration];
[self setState:kPullToRefreshViewStateLoading];
[UIView commitAnimations];

if ([delegate respondsToSelector:@selector(pullToRefreshViewShouldRefresh:)])
[delegate pullToRefreshViewShouldRefresh:self];
}
}

Expand Down