Offsetting UIRefreshControl

user754905 picture user754905 · Jun 26, 2013 · Viewed 24.1k times · Source

I am currently using a JASidePanel for my application and I have a UITableViewcontroller with a UIRefreshControl as one of the ViewControllers for it. The width of my tableview still has a width of 320 pixels so the UIRefreshControl gets centered right in the middle of the view. I'm trying to figure out if there's a way to offset the UIRefreshControl (moving the x by 20 pixels to the left) so that it looks centered when I have my side panel visible.

Thanks! JASidePanel

Answer

user1195202 picture user1195202 · Jul 3, 2014

Try editing the bounds. For example, to move the control down +50px:

refreshControl.bounds = CGRectMake(refreshControl.bounds.origin.x,
                                   -50,
                                   refreshControl.bounds.size.width,
                                   refreshControl.bounds.size.height);
[refreshControl beginRefreshing];
[refreshControl endRefreshing];