Xamarin.Forms Guides | Samples

Xamarin.Forms.VisualElement.Focus Method

Attemps to set focus to this element.

Syntax

public Boolean Focus ()

Returns

true if the keyboard focus was set to this element; false if the call to this method did not force a focus change.

Remarks

Element must be able to receive focus for this to work. Calling Focus on offscreen or unrealized elements has undefined behavior.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0