2011-05-27 35 views

回答

3

基本上你需要做的是在tableView:CellForRowAtIndexPath:方法

cell.textLabel.textColor = yourColor; 

下面如果你想使用自定義的細胞更多信息,你可以看看我的博客Effective Mobility

2

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

地址:

cell.textLabel.textColor = [UIColor redColor]; 
+0

我想在tableview的每一行的文本上使用不同的顏色。 – 2011-05-27 14:05:29

0

讓你的所有行顏色在NSArray中。讓我們說myColorArray,它將包含行的所有UIColor對象。

,做cell.textLabel.textColor = [myColorArray objectAtIndex:indexPath.row];

tableView:CellForRowAtIndexPath:功能。