Skip to content

Commit

Permalink
Merge pull request samvermette#106 from mertdumenci/master
Browse files Browse the repository at this point in the history
Fixed setting a custom view left the older ones as subviews
  • Loading branch information
samvermette committed Jan 30, 2013
2 parents 49b27e8 + 4c4dcb3 commit 4a5c985
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SVPullToRefresh/UIScrollView+SVPullToRefresh.m
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ - (void)layoutSubviews {
self.arrow.hidden = hasCustomView;

if(hasCustomView) {
for (UIView *subview in self.subviews) {
[subview removeFromSuperview];
}

[self addSubview:customView];
CGRect viewBounds = [customView bounds];
CGPoint origin = CGPointMake(roundf((self.bounds.size.width-viewBounds.size.width)/2), roundf((self.bounds.size.height-viewBounds.size.height)/2));
Expand Down

0 comments on commit 4a5c985

Please sign in to comment.