如何在tableview中爲多行設置不同的顏色,最多可以設置10種不同的顏色。我想出了替代行顏色的部分。如何爲tableview單元格設置不同的顏色
//alternate row colour
if (indexPath.row % 2) {
cell.contentView.backgroundColor = [[UIColor alloc]initWithRed:87.0/255.0 green:84.0/255.0 blue:229.0/255.0 alpha:1];
} else {
cell.contentView.backgroundColor = [[UIColor alloc]initWithRed:187.0/255.0 green:184.0/255.0 blue:229.0/255.0 alpha:1];
}
你試過了什麼? – rishi
只是上面的,%3和我被卡住了 – mugunthan
你面對%3的問題是什麼? – rishi