在UITableViewCell上调暗tintColor

时间:2013-09-17 16:27:46

标签: ios uiview uitableview ios7

这是一个UITableViewCell,它打开一个模态('添加成分'):

enter image description here

我正在设置标签颜色以匹配应用程序的tintColor:

cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
cell.textLabel.text = @"Add Ingredients...";
cell.textLabel.textColor = [self.view tintColor];

如果出现UIAlertViewUIActionSheet,如何调暗文字颜色?此行为是按钮和其他控件的默认行为,但不适用于单元格的文本标签。

我找到了对tintAdjustmentMode和tintColorDidChange的引用,但不知道如何使用它们。

或者我应该在我的手机上添加一个按钮?我以前使用这种方法的经验并不是最优的 - 有反应性的副作用。

1 个答案:

答案 0 :(得分:1)

我相信你是对的。您应该只能覆盖CustomUITableViewCell中的tintColorDidChange方法。

http://www.qubop.com/ios7.pdf