Set text color and font for UIDatePicker in iOS8/Swift

后端 未结 16 2226
囚心锁ツ
囚心锁ツ 2020-12-03 21:02

I\'ve been having trouble trying to set the UIDatePicker font and color. Everything else in my app was fairly straightforward to adjust except

16条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 21:30

    This worked for me:

    setting text color for all date picker subviews

    for view in datePicker.subviews {
        view.setValue(UIColor.white, forKeyPath: "textColor")
    }
    

提交回复
热议问题