在表格单元格中更改uifont颜色 [英] changing uifont color in a table cell

查看:40
本文介绍了在表格单元格中更改uifont颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下代码更改单元格的颜色,但是它将所有单元格显示为白色字体,而不是我的金色rgb颜色代码.

i am trying to change the color of the cell using the following code, however it displays all the cell's as white font instead of the gold rgb color code i have.

if (row == 0)

    cell.detailTextLabel.text=@"An blah blah";
    cell.textLabel.textColor = [UIColor colorWithRed:139 green:136 blue:120 alpha:1];

推荐答案

您将其设置在错误的标签上,这应该可以工作:

You're setting it on the wrong label, this should work:

cell.detailTextLabel.text=@"An blah blah";
cell.detailTextLabel.textColor = [UIColor colorWithRed:139/255.0f green:136/255.0f blue:120/255.0f alpha:1];

这篇关于在表格单元格中更改uifont颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆