Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set UIDatePicker background color in Interface Builder?

When I set background color for UIDatePiceker in Interface Builder, nothing happens: the backgroundColor property is nil. But when I do it in code, it works fine. What's happening?

like image 689
efpies Avatar asked Jun 11 '14 19:06

efpies


1 Answers

A work around I'm using is just creating a UIView behind it with a white background. Adding the same constraints as the date view (I also added a height constraint which may be redundant for the UIDatePicker but I needed it for the view behind it).

May be more work than you're looking for but it works for me instead of coding an outlet and setting the background on viewdidload.

like image 80
Matthew Zackschewski Avatar answered Oct 16 '22 18:10

Matthew Zackschewski