can i change the text color for each line in 1 cell, i know i can make it using custom cells, but i want to know if its possible to do it without making custom cells
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CustomCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [array objectAtIndex:indexPath.row];
cell.textLabel.font = [UIFont systemFontOfSize:18];
cell.textLabel.numberOfLines = 3;
return cell;
}
you could do a modulo 2 on the indexPath and check if its 0. if it is, use one color, if not use another as background for example. This way you color every second cell if that is what you intent