Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.

id title brief sdk
Setting the Focus to a UITextField
Code can manually change the focus of a view to bring up the keyboard for entry in a UITextField without tapping it.


Focus Screen

To have our UITextField, in this case named FocusTextField, selected as soon as we open the view, we can place the following line of code in the ViewDidLoad() method:

FocusTextField.BecomeFirstResponder ();

Additional Information

We can call BecomeFirstResponder on a UITextField at any point to switch focus - not just inside ViewDidLoad.