我想在下面使用sl.asl粗體,並根據它的數值在下面給它着色。有任何想法嗎?新手需要幫助:基於值的粗體字體和文本顏色
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateStyle:NSDateFormatterShortStyle];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
// Configure the cell...
ServiceLevel *sl = (ServiceLevel *)[self.importedRows objectAtIndex:indexPath.row];
cell.textLabel.text = [NSString stringWithFormat:@"%@ - %@", sl.name , sl.asl];
return cell;
}
低於該看看我的回答coveres你對你的文本的一部分設置爲黑體和覆蓋改變基於數字小值的顏色的能力的所有問題。這是關於如何實現所有這些事情的完整解釋:)退房。祝你好運 – Pavan