自定义定时器选择器IOS时钟

时间:2016-05-20 06:43:41

标签: ios iphone ipad cocoa-touch uikit

我想在iOS中自定义时钟应用程序的计时器选择器的外观(基本上它是带有计时器模式的UIDatePicker)。我想更改选取器的文本颜色和边框线颜色,但根据文档,无法自定义外观。任何人都可以使用自定义选择器的方法。 感谢

1 个答案:

答案 0 :(得分:0)

您可以自定义类似的日期选择器,

目标c:

targetedDatePicker.backgroundColor = [UIColor blackColor];

[targetedDatePicker setValue:[UIColor greenColor] forKey:@"textColor"];

[targetedDatePicker setValue:@"0.8" forKey:@"alpha"];

斯威夫特:

targetedDatePicker.backgroundColor = UIColor.blueColor()
targetedDatePicker.setValue(UIColor.greenColor(), forKeyPath: "textColor")
targetedDatePicker.setValue(0.8, forKeyPath: "alpha")

所以,您可以像这样自定义datepicker外观

希望这会有所帮助:)

相关问题