2011-05-27 93 views

回答

0

使用下面的代碼:

-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    static NSString *cellIdentifier = @"my cell id"; 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 
    if (nil == cell) { 
     cell = [[[UITableViewCell alloc] init] autorelease]; 
    } 
    //your custom init of a cell here 
    ... 
    if (indexPath.row == 0) { 
     cell.textLabel.textColor = [UIColor whiteColor]; 
    } else if (indexPath.row == 1) { 
     cell.textLabel.textColor = [UIColor redColor]; 
    } ... 
    return cell; 
}