【发布时间】:2012-02-09 12:23:45
【问题描述】:
我真的很喜欢这种感觉。
还有一些其他系统颜色,我在 UIColor 文档中找不到它们的 API,
如nib文件中按钮的默认文字颜色等
那么有什么方法可以使用它们吗?
我的意思是,它们只是颜色,没有风险,对吧?
或者是否有任何与它们相似的 RGBA 值?非常感谢!
【问题讨论】:
-
我想你问的是 cell.detailTextLabel.textColor?
我真的很喜欢这种感觉。
还有一些其他系统颜色,我在 UIColor 文档中找不到它们的 API,
如nib文件中按钮的默认文字颜色等
那么有什么方法可以使用它们吗?
我的意思是,它们只是颜色,没有风险,对吧?
或者是否有任何与它们相似的 RGBA 值?非常感谢!
【问题讨论】:
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
[[cell detailTextLabel] textColor]
textColor 只会返回单元格 detailTextLabel 的 UIColor 对象。
【讨论】:
[UIColor colorWithRed:0.22 green:0.33 blue:0.53 alpha:1],仅供参考。
通过将模拟器的屏幕截图拉到 Photoshop 中,我得到以下值:
[UIColor colorWithRed:0.22 green:0.33 blue:0.55 alpha:1.0]
在设备上看起来非常接近我的眼睛。但是 muffe2k 的答案总是有效的。
【讨论】:
我将[UIColor grayColor] 用于UITableViewCell.detailsTextLabel.textColor。乍一看,grayColor 和原始颜色没有区别。
【讨论】: