在UITableViewCell上调暗tintColor [英] Dimming a tintColor on a UITableViewCell
问题描述
这是一个打开模态的UITableViewCell('添加成分'):
Here is a UITableViewCell that opens a modal ('Add Ingredients'):
我设置标签颜色以匹配应用程序的tintColor:
I am setting the label color to match the application's tintColor:
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
cell.textLabel.text = @"Add Ingredients...";
cell.textLabel.textColor = [self.view tintColor];
当 UIAlertView $ c $时,如何调暗文本颜色?是否提供了c>或
UIActionSheet
?此行为是按钮和其他控件的默认行为,但不适用于单元格的文本标签。
How do I dim the text color when a UIAlertView
or UIActionSheet
is presented? This behavior is default for buttons and other controls, but not for a cell's text label.
我找到了对tintAdjustmentMode和tintColorDidChange的引用,但不知道如何使用。
I have found references to tintAdjustmentMode and tintColorDidChange, but do not know how to use either.
或者我应该在我的手机上添加一个按钮?我之前使用这种方法的经验不是最优的 - 有反应性的副作用。
Or should I be adding a button to my cell? My previous experience with this approach wasn't optimal - there were side-efffects with responsiveness.
推荐答案
我相信你是对的。您应该只能覆盖CustomUITableViewCell中的tintColorDidChange方法。
I believe you are correct. You should just be able to override the tintColorDidChange method in your CustomUITableViewCell.
这篇关于在UITableViewCell上调暗tintColor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!