如何在使用inputView后显示键盘

Pav*_*nen 7 xcode uipickerview uitextfield ios inputview

我曾经为我inputView展示uipickerviewtextfield,但我也用它来做textfield其他功能.我如何能显示标准键盘我用后inputViewtextfield

textfield.inputView = pickrView;
Run Code Online (Sandbox Code Playgroud)

Pav*_*nen 13

只是

textfield.inputView = nil;

为我工作


小智 5

正如Pavel Kaljunen所说,你只需要将inputView设置为nil,但是当键盘已经可见时,你必须首先使用resignFirstResponder,将inputView设置为nil然后再次设置为FirstResponder.

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.35];

[yourTextField resignFirstResponder];
yourTextField.inputView = nil;
[yourTextField becomeFirstResponder];

[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)