How can I show a UIDatePicker instead of a keyboard when a user selects a UITextField?

后端 未结 4 1991
忘了有多久
忘了有多久 2021-02-14 14:32

I have a nice clean UI within a table view which has a few text fields for the user to fill out. One of the fields is for the user\'s birthday.

I\'d like to have it so t

4条回答
  •  眼角桃花
    2021-02-14 15:23

    Regarding animation, take a look at DateCell sample application - http://developer.apple.com/library/ios/#samplecode/DateCell/Introduction/Intro.html

    And in any case, the proper way to do this is set UITextField's inputView to show the picker instead of the keyboard. That's what it's meant to do. More on that here: How can I present a picker view just like the keyboard does?

    Cheers,

    Oded.

提交回复
热议问题