在UITableViewCell上调暗tintColor [英] Dimming a tintColor on a UITableViewCell

查看:312
本文介绍了在UITableViewCell上调暗tintColor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个打开模态的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 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.

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

这篇关于在UITableViewCell上调暗tintColor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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