XFPINView icon indicating copy to clipboard operation
XFPINView copied to clipboard

How to open keyboard on appear?

Open Kiriakos41 opened this issue 2 years ago • 1 comments

How to open keyboard on appear via xamarin forms focus dosent work..

Kiriakos41 avatar Feb 24 '23 15:02 Kiriakos41

There is a method called FocusBox() that lets you set focus on the hidden text entry.

/// Calling this, will bring up the soft keyboard, or will help focus the control
/// </summary>
public void FocusBox()
{
    boxTapGestureRecognizer?.Command?.Execute(null);
}

So in your code-behind you can just call:

protected override void OnAppearing()
{
    base.OnAppearing();
    XfPinView.FocusBox();
}

christian-strydom avatar Jul 18 '23 06:07 christian-strydom