如何仅更改一个 tableviewcell textlable.text 的颜色?
How to change color of only one tableviewcell textlable.text?
在我的 UITableView 中,我有 7 个 tableviewcell,我只想更改第 5 个的文本颜色 cell.Is 可能吗?
我试过静态电池,但它对我不起作用,因为我只想要一个 cell.textlable.textcolor 改变而不是其他电池。
像这样使用
if(indexPath.row==4)
{
yourCell.textLabel.textColor=[UIColor redColor];
}
else
{
yourCell.textLabel.textColor = [UIColor blackColor];
}
if([cell.m_mainListLbl.text isEqualToString:@"Logout"])
{
cell.m_mainListLbl.textColor=[UIColor redColor]; return cell;
}
我使用了这个代码。
对我有用。
在我的 UITableView 中,我有 7 个 tableviewcell,我只想更改第 5 个的文本颜色 cell.Is 可能吗?
我试过静态电池,但它对我不起作用,因为我只想要一个 cell.textlable.textcolor 改变而不是其他电池。
像这样使用
if(indexPath.row==4)
{
yourCell.textLabel.textColor=[UIColor redColor];
}
else
{
yourCell.textLabel.textColor = [UIColor blackColor];
}
if([cell.m_mainListLbl.text isEqualToString:@"Logout"])
{
cell.m_mainListLbl.textColor=[UIColor redColor]; return cell;
}
我使用了这个代码。 对我有用。