How to replace UIPickerView with native keyboard back?

时间:2016-04-15 15:00:01

标签: ios objective-c keyboard uitextfield uipickerview

I need to dynamically change the input for UITextField: keyboard with pickerView and back (pickerView with keyboard).

I know how to substitute keyboard with pickerView - via input property of textfield.

But I don't know to substitute pickerView with keyboard back. How can I do this?

The flow is following:

  • user need to enter some value into textfield (typing via keyboard)
  • then I'll show them some clarification options via pickerView, user select any option and it will appear into textfield
  • then user should be able to edit the selected value in the textfield via native keyboard

Thank you

1 个答案:

答案 0 :(得分:1)

你可以使用,

textfield.inputView = nil;

如果您想在此之后直接显示键盘,则可以使用

[textfield becomeFirstResponder];

希望这会奏效。 :)