Search code examples
iosios7

invert UIDatePicker colors in iOS 7


I want to start by saying that i would post this question on the Apple Dev Forums but because of the hacking attempt fiasco , or whatever that was, the forum has been offline for almost 2 weeks now and i need a solution for this as soon as possible.

In iOS 7 the UIDatePicker looks like this : enter image description here

and a client asked to look like this : enter image description here

(basically inverted).

I've tried a few things:

  1. Setting the background to black and looping through all the view's subviews until i reach the labels that show the date itself and change their color to white. The problem is that The view has only one subview, and that subview doesn't have any subviews of it's own. So this solution doesn't work. (it did in ios6).

  2. Applying a filter to the view's CALayer. The thing is that this is only possible on OS X not on iOS, for some unknown reason.

  3. Playing with UIApperance protocol. From what i've read this should work but what i've tried didn't and i don't have extensive experience with this to figure out why not.

Any ideas what i can try? Is this even possible? Did i made a mistake in my approach of the problem?


Solution

  • What you want is possible, but it will be called Custom Date Picker.

    Below is the link where you will find what you wanted.

    https://www.cocoacontrols.com/controls/simpledatepicker

    If you need more, take a loot at below link.

    https://www.cocoacontrols.com/search?utf8=%E2%9C%93&q=datepicker