設置tableViewCell的背景顏色

- (void)tableView: (UITableView*)tableView willDisplayCell: (UITableViewCell*)cell forRowAtIndexPath: (NSIndexPath*)indexPath

{

    cell.backgroundColor = indexPath.row % 2?[UIColor colorWithRed: 240.0/255 green: 240.0/255 blue: 240.0/255 alpha: 1.0]: [UIColor whiteColor];

    cell.textLabel.backgroundColor = [UIColor clearColor];

    cell.detailTextLabel.backgroundColor = [UIColor clearColor];

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章