【发布时间】:2014-09-18 11:02:47
【问题描述】:
我搜索了任何特定的词,例如“上帝”。我想更改特定的单词文本颜色应该以不同的颜色更改。我尝试在谷歌上搜索,但我发现特定索引值的特定单词颜色从单词Link 的开头到结尾发生了变化,这就是我的问题没有解决的原因。
请帮助我并更新我的代码以更改特定单词文本颜色,即您在图像中看到的框中的单词。
谢谢
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:UYLCellIdentifier forIndexPath:indexPath];
[self configureCell:cell forRowAtIndexPath:indexPath];
return cell;
}
- (void)configureCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell isKindOfClass:[UYLTextCellSearch class]])
{
UYLTextCellSearch *textCell = (UYLTextCellSearch *)cell;
DataBase *DBContentDetail = [_sourceData objectAtIndex:indexPath.row];
textCell.lineLabel.text = [NSString stringWithFormat:@"%@",DBContentDetail.dbtext];
[textCell.lineLabel sizeToFit];
}
}
【问题讨论】:
标签: ios objective-c uitableview