UITableViewCell is transparent when not supposed to be

Posted by David Liu on Stack Overflow See other posts from Stack Overflow or by David Liu
Published on 2010-06-03T03:10:15Z Indexed on 2010/06/03 3:14 UTC
Read the original article Hit count: 314

My UITableViewCell is being transparent when it's not supposed to be. My table view has a background color and it shows through the table cell, even though they're supposed to be opaque. I'm not sure why this is.

Relevant code:

    UITableViewCell *cell = [table dequeueReusableCellWithIdentifier:emptyIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:emptyIdentifier] autorelease];
    }

    cell.textLabel.text = @"Empty";
    cell.textLabel.textAlignment = UITextAlignmentCenter;
    cell.textLabel.backgroundColor = [UIColor whiteColor];
    return cell;

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c