views:

154

answers:

2

Hello,

I currently use MonoTouch with MonoTouch.Dialog. When tapping on a date field it pushes the navigationcontroller so you go right a screen to see your UIDatePicker where you choose the date then go "back" to the main screen again. I'd really like to have this UI like other apps I've used that when you select a date field the UIDatePicker appears at the bottom of the current screen.

I would like to learn how to do this and apply it to other input fields where I may want to use a custom picker that also presents itself at the bottom of the current screen.

Does anyone have any code to share that would allow a UIPicker/UIDatePicker to appear at the bottom of the active screen?

Thank you.

A: 

You just create a UIPickerView normally, but set its frame outside of the visible area. Once you click on a cell, you change the origin point of the UIPickerView's frame, so that the picker view will become visible. You can animate the property frame, so you can make a nice soft animation that your picker view will slide in from the lower boundary of the phone.

burki
+2  A: 

Have a look at my article about working with pickers.

An inputView property of UIResponder class is what you are looking for.

lechec