ODRefreshControl
ODRefreshControl copied to clipboard
Custom activity view is garbled when portrait/landscape mode gets changed
A strang behaviour occurs using custom activities.
I set a custom activity view (UIProgressView). Using the demo App, I wrapped the ViewController of the demo code in a UINavigationController
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = navigationController;
and modified the ViewController as follows.
- (void)viewDidLoad
{
[super viewDidLoad];
UIProgressView *progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(0, 0, 200, 20)];
progressView.progress = 0.5;
refreshControl = [[ODRefreshControl alloc] initInScrollView:self.tableView activityIndicatorView:progressView];
[refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(doRefresh)];
}
- (void)doRefresh {
[refreshControl beginRefreshing];
[self.tableView setContentOffset:CGPointMake(0, -44) animated:YES];
[self dropViewDidBeginRefreshing:refreshControl];
}
I perform one refresh in portrait, rotate to landscape and perform a second refresh. I get several copies of the UIProgressView drawn. The same happens if I start on landscape and then turn to portrait.