更改UIDatePicker字体颜色? [英] Change UIDatePicker font color?
本文介绍了更改UIDatePicker字体颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所有我想做的是更改UIDatePicker的字体颜色。我研究了其他问题,但他们都涉及改变其他属性和自定义整个外观。我想做的只是将字体颜色从黑色更改为白色。我发现很难相信我不能做这样一个看似简单的任务。为什么不是色彩的影响呢?
All I want to do is change the font color of the UIDatePicker. I've researched other questions but they're all involving changing other properties and customizing the entire look. All I want to do is just change the font color from black to white. I find it hard to believe that I can't do such a seemingly simple task. And why wouldn't the tint color affect it? Does it even do anything?
推荐答案
我需要的所有(在iOS 8.x和9.0上)都是这一行,字体颜色:
All I need (on iOS 8.x and 9.0) is this one line to change the font color:
[my_date_picker setValue:[UIColor whiteColor] forKey:@"textColor"];
没有子类化或调用私有API ...
No subclassing or invoking of private APIs...
这篇关于更改UIDatePicker字体颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文