J Buff
J Buff

Reputation: 35

How to make numeric keyboard appear on entry of view controller in Xamarin.iOS?

I would like to make the numeric keyboard appear on entry of a view controller. What would I need to add to the back end to do that, and would I put it in the ViewDidLoad()?

Thanks, Josh

Upvotes: 0

Views: 1167

Answers (2)

Wax
Wax

Reputation: 51

You can set the KeyboardType of your UITextField and call BecomeFirstResponder to display the keyboard.

yourUITextField.KeyboardType = UIKeyboardType.NumberPad;
yourUITextField.BecomeFirstResponder();

Upvotes: 0

Jason
Jason

Reputation: 89204

call BecomeFirstResponder on any UITextField (or other keyboard control) in your View

myUITextField.BecomeFirstResponder();

Upvotes: 2

Related Questions