AccessibilityNodeInfo.FocusSearch(FocusSearchDirection) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Searches for the nearest view in the specified direction that can take the input focus.
[Android.Runtime.Register("focusSearch", "(I)Landroid/view/accessibility/AccessibilityNodeInfo;", "GetFocusSearch_IHandler")]
public virtual Android.Views.Accessibility.AccessibilityNodeInfo? FocusSearch (Android.Views.FocusSearchDirection direction);
[<Android.Runtime.Register("focusSearch", "(I)Landroid/view/accessibility/AccessibilityNodeInfo;", "GetFocusSearch_IHandler")>]
abstract member FocusSearch : Android.Views.FocusSearchDirection -> Android.Views.Accessibility.AccessibilityNodeInfo
override this.FocusSearch : Android.Views.FocusSearchDirection -> Android.Views.Accessibility.AccessibilityNodeInfo
Parameters
- direction
- FocusSearchDirection
The direction. Can be one of:
View#FOCUS_DOWN
,
View#FOCUS_UP
,
View#FOCUS_LEFT
,
View#FOCUS_RIGHT
,
View#FOCUS_FORWARD
,
View#FOCUS_BACKWARD
.
Returns
The node info for the view that can take accessibility focus.
- Attributes
Remarks
Searches for the nearest view in the specified direction that can take the input focus.
<strong>Note:</strong> If this view hierarchy has a SurfaceView
embedding another view hierarchy via SurfaceView#setChildSurfacePackage
, there is a limitation that this API won't be able to find the node for the view in the specified direction on the embedded view hierarchy. It's because views don't know about the embedded hierarchies. Instead, you could traverse all the children to find the node.
Java documentation for android.view.accessibility.AccessibilityNodeInfo.focusSearch(int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.