Why doesn't UITableViewCell background color work (set in interface builder)?

前端 未结 14 1885
青春惊慌失措
青春惊慌失措 2020-12-23 11:43

Why doesn\'t UITableViewCell background color work (set in interface builder)?

I note from some searching that the follow code set in your custom subclass of UITable

14条回答
  •  滥情空心
    2020-12-23 12:04

    Try this it works for me:

    - (void)tableView:(UITableView *)tableView1 willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
    {
        [cell setBackgroundColor:[UIColor clearColor]];
        tableView1.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @"Cream.jpg"]];
    }
    

提交回复
热议问题