4

I have a date picker which is shown using an action sheet. I want to insert a blank value in date picker and set it as default value. It should change only on user selection. Is this possible? If yes how? All valuable suggestions are appreciated.

Siddharth
  • 555
  • 4
  • 19

1 Answers1

3

UIDatePicker only supports certain modes and doesn't allow this kind of customization (adding in blank or custom data into the spinning pickers). Oh, the documentation indicates it doesn't inherit from UIPickerView either so you can't easily get at the custom picker-view object that it works with.

Why not create your own view and controller pair that implements the UIPickerViewDelegate and create your own - you may find a little more detail and useful hints in this related question.

Or, consider a different & less painful way to accomplish what you're trying to do.

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • Thank you for the reply.Since I preffered a less painful way to implement that I created a "Clear" button on the action sheet to bring about the blank data. :) – Siddharth Dec 14 '11 at 10:12