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

自定义计时器选择器IOS时钟,ios,iphone,ipad,cocoa-touch,uikit,Ios,Iphone,Ipad,Cocoa Touch,Uikit,我想定制iOS中时钟应用程序的计时器选择器的外观(基本上是一个带计时器模式的UIDatePicker)。我想更改选择器的文本颜色和边框线颜色,但根据文档,无法自定义外观。任何人都可以定制选择器。 谢谢您可以定制datepicker之类的东西 目标c: targetedDatePicker.backgroundColor = [UIColor blackColor]; [targetedDatePicker setValue:[UIColor greenColor] forKey:@"textC

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

您可以定制datepicker之类的东西

目标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")
Swift:

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外观


希望这会有所帮助:)

谢谢你的回答。这种方法对IPad有效,但对IPhone无效