0

I tried this code to display the keyboard, but it didn't work:

UIApplication.SharedApplication.KeyWindow.EndEditing(false);

Is there a way for Xamarin iOS to display the soft keyboard?

ychang
  • 1
  • 1

1 Answers1

0

First of all , we would need a control which could receive input like UITextField and UITextView .

The way to show soft keyboard programmatically is pretty simple , just call becomeFirstResponder method .

What's more , UIApplication.SharedApplication.KeyWindow.EndEditing(false) should be working as well , you can have a try .


If you don't want to add a UITextField/UITextView , as a workaround you could customize a view and implementet UIKeyInput protocol(canBecomeFirstResponder method).

Please refer to the details below

It is possible to show keyboard without using UITextField and UITextView iphone app?.


To be clear , if you don't have UITextField/UITextView or custom view implementing UIKeyInput protocol on currect viewcontroller, it is impossible to show the soft keyboard programmatically .

ColeX
  • 14,062
  • 5
  • 43
  • 240