Pregunta

After upgrading to xcode 5, I notice there is a flicker on the edge of the screen when transitioning between two screen. The flicker shows up as a vertical white line on the edge of the frame. This only appears to be happening on ios7.

The transition that I have between the two screens is via a storyboard segue.

UPDATE:

I fixed the issue by adding: self.view.clipsToBounds = YES; to my views.

¿Fue útil?

Solución

I figured out the issue. I had to set clipsToBounds to YES on my views. This fixes the problem.

Otros consejos

This issue comes in iOS7 when you try to update UI from background. So as to avoid above, you should update UI using GCD Method as shown below.

dispatch_sync(dispatch_get_main_queue(), ^{
      // Update UI (e.g. Alert, label changes etc)
});

or

dispatch_async(dispatch_get_main_queue(), ^{
      // Update UI (e.g. Alert, label changes etc)
});

This will make sure to update in main queue.

I had this issue with tableView Segues in iOS7 and the clipsToBounds BOOL did nothing for me. The fix for me was by loading my background image in viewDidAppear as opposed to viewDidLoad. example below:

- (void)viewDidLoad
{
    [super viewDidLoad];

    tableData = [NSArray arrayWithObjects:@"First", @"Second", @"Third", nil];
    [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    UIEdgeInsets inset = UIEdgeInsetsMake(5, 0, 0, 0);
    self.tableView.contentInset = inset;

//Don't load your background image or color here
}


-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    [[AppDelegate sharedInstance] setNavTitle:@"Title"];

//load your background image here

    self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage     imageNamed:@"FirstViewBackground"]];
    self.tableView.backgroundColor = [UIColor clearColor];



}

Ok, I've solved the issue in my situation.

I had some custom UIView inside Container View. Container View had Background Color (probably I accidentally did this) set to White color. And between transitions I saw white line flickering (sometimes, randomly). When I set Container's View colour to Default, flickering on transitions disappeared.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top