怎样在ios开发中设置tableview的cell颜色

//方法一:
cell .contentView .backgroundColor = [ UIColor redColor ];
//方法二:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier :CellIdentifier];
UIView* bgview = [[ UIView alloc ] initWithFrame :CGRectMake( 0 , 0 , 1 , 1 )];
bgview .opaque = YES ;
bgview .backgroundColor = [ UIColor orangeColor ];
[cell setBackgroundView :bgview];
//方法三:
- ( void )tableView:( UITableView *)tableView willDisplayCell :( UITableViewCell *)cell forRowAtIndexPath :( NSIndexPath *)indexPath
{
cell .backgroundColor = [ UIColor redColor ];
}
posted @ 2013-06-19 20:56  jlins  阅读(4530)  评论(0编辑  收藏  举报