views:

182

answers:

2

I'm experiencing a bad looking graphical glitch with UIDatePicker, and I'm wondering if anyone else has seen and/or resolved it. It is something non-deterministic, because every once in a while it goes away and looks normal.

Check out the highlight and shadow bars are shifted...

alt text

I have tried removing all other graphical elements. I have tried removing my slide-up animation so that it just appears in place (I thought there might be a break in animating the sub-views). At this point, I'm out of ideas for isolating this thing.

Thoughts? Thanks guys.

+2  A: 

It looks like the picker view has been resized which they shouldn't be (as shown in IB by their frame properties being greyed out). I'd imagine this is the cause of the problems.

Daniel Tull
That's done it, thanks man. I elaborated on the solution in my own answer, but you were correct.
DougW
+1  A: 

Wow, so yeah, big "f you" from Apple to all the devs who don't use their crap Interface Builder. Turns out Daniel was correct and there is indeed a resizing bug with UIDatePicker. No mention of this in the documentation.

I would have left this as a comment to his answer, but I wanted to elaborate on the solution.

You can set the frame origins to anything, but the size MUST be 320.0, 216.0 or else you will have non-deterministic graphical glitches.

I would also like to link to this spot-on blog post about some strange date issues with the UIDatePicker control. The NSDate class was basically a huge screw up from a localization standpoint, and they've attempted to deprecate the issues, creating an even worse disaster in the process.

DougW