Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom activity view is garbled when portrait/landscape mode gets changed #40

Open
thorar opened this issue Oct 28, 2012 · 0 comments
Open

Comments

@thorar
Copy link

thorar commented Oct 28, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant