2
votes

I have my scroll view span the whole height of the iPhone. Thus, the iPhone's semi-transparent status bar is overlayed on top of the scroll view. I've added iOS6's UIRefreshControl to the scroll view, like so:

UIRefreshControl *pullToRefresh = [[UIRefreshControl alloc] init];
[pullToRefresh addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
self.refreshControl = pullToRefresh;
[self.scrollView addSubview:refreshControl];

Everything functionally works great. However, the pull to refresh icon doesn't pull down low enough to clear the iPhone status bar. This looks junky, like so:

Pull to Refresh

I've tried setting the frame/bounds on the UIRefreshControl to reposition the refresh icon, but no luck. Any ideas would be much appreciated!

1
you need to change the position of UIScrollview instead..HarshIT
the scrollview goes behind status bar as your statusbar is transparent.HarshIT
Yup, Sharanya, you are correct. That answer (by subclassing UIRefreshControl) works! Thanks.ChrisJF

1 Answers

2
votes

Try setting a contentInset of 20 px at the top. That is a property on UIScrollView.