如何更改日期选择器当前日期的文本颜色? [英] How to change the datepicker current date text color?

查看:144
本文介绍了如何更改日期选择器当前日期的文本颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于使用深色背景的日期选择器,因此将其textColor设置为白色。除当前日期外,所有日期文本均显示我想要的内容。如果今天是2015年7月23日,则其文字将为黑色,而不是白色。

Since using datepicker with a dark background color, I set its textColor to white. All the date text shows what I want except the current date. If today is 7/23/2015, its text will be black but not white.

我尝试过并没有找到解决方案,有人可以提供帮助吗?

I tried and found no solution, anyone can help?

当前日期文本颜色

不是当前日期的文本颜色:

Not current date text color:

推荐答案

同时初始化日期选择器时,请编写以下代码,或者如果您从IBOutlet获取了datePicker,请在viewDidLoad [yourDatePicker setValue:[ UIColor whiteColor] forKey:@ textColor];

When you initialize date picker at the same time write the below code or if you had taken datePicker from IBOutlet write it in viewDidLoad [yourDatePicker setValue:[UIColor whiteColor] forKey:@"textColor"];

这篇关于如何更改日期选择器当前日期的文本颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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