Black Corners On Grouped UITableViewCells Only After Navigation Pops

Posted by coneybeare on Stack Overflow See other posts from Stack Overflow or by coneybeare
Published on 2010-05-11T14:38:49Z Indexed on 2010/05/12 14:44 UTC
Read the original article Hit count: 212

I am not graphics expert but I somehow managed to make some good looking custom grouped UITableViewCells by setting the background view to a backgroundView with some CG code. In all SDK's up to 3.1.3 (maybe 3.2... I haven't tested on the iPad) this was working great, but I think a more recent SDK has introduced a change in the way graphics are cached offscreen.

Upon first render, everything is great: The drawing is fine and the corners are transparent. If I push a couple of view controllers on the navigation stack and come back, there are now black corners that appear in the views:

BEFORE && AFTER

alt text alt text

I have tons of code, most of which is written up here. I have tried tweaking to the best of my ability, looking at the docs for applicable changes, but after at least 8 hours in I still cannot find what might cause this. I have tried setting every view I can think of to be backgroundColor=clearColor and opaque=NO What else am I missing? Any debugging tips?




UPDATE:
I have some debug code in viewDidAppear that prints the backgroundColor and class description of all the subviews.

- (void)debugView:(UIView *)view {
    DebugLog(@"%@ - %@", view.backgroundColor, [[view class] description]);
    for (UIView* child in view.subviews) {
        [self debugView:child];
    }
}
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [DownloadController.networkQueue setSuspended:NO];
    for (TTTableViewCell *cell in [self.tableView visibleCells]) {
        [cell debugView:cell];
    }
}

With this code, I inspect the backgroundColor settings of the cell views on first load, when it is fine, and then again after coming back. There are some differences, but all the colors are still set to be clear. This leads me to believe the issue is underneath the UITableViewCell.




UPDATE 2:
I have created a simple sample application to highlight the problem here

© Stack Overflow or respective owner

Related posts about uitableviewcell

Related posts about uitableview