AccessibilityNodeInfo.AddChild Method

Definition

Overloads

AddChild(View, Int32)

Adds a virtual child which is a descendant of the given root.

AddChild(View)

Adds a child.

AddChild(View, Int32)

Adds a virtual child which is a descendant of the given root.

[Android.Runtime.Register("addChild", "(Landroid/view/View;I)V", "GetAddChild_Landroid_view_View_IHandler")]
public virtual void AddChild (Android.Views.View? root, int virtualDescendantId);
[<Android.Runtime.Register("addChild", "(Landroid/view/View;I)V", "GetAddChild_Landroid_view_View_IHandler")>]
abstract member AddChild : Android.Views.View * int -> unit
override this.AddChild : Android.Views.View * int -> unit

Parameters

root
View

The root of the virtual subtree.

virtualDescendantId
Int32

The id of the virtual child.

Attributes

Remarks

Adds a virtual child which is a descendant of the given root. If virtualDescendantId is View#NO_ID the root is added as a child.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure. Note that a view cannot be made its own child.

Java documentation for android.view.accessibility.AccessibilityNodeInfo.addChild(android.view.View, 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.

Applies to

AddChild(View)

Adds a child.

[Android.Runtime.Register("addChild", "(Landroid/view/View;)V", "GetAddChild_Landroid_view_View_Handler")]
public virtual void AddChild (Android.Views.View? child);
[<Android.Runtime.Register("addChild", "(Landroid/view/View;)V", "GetAddChild_Landroid_view_View_Handler")>]
abstract member AddChild : Android.Views.View -> unit
override this.AddChild : Android.Views.View -> unit

Parameters

child
View

The child.

Attributes

Exceptions

If called from an AccessibilityService.

Remarks

Adds a child.

<strong>Note:</strong> Cannot be called from an android.accessibilityservice.AccessibilityService. This class is made immutable before being delivered to an AccessibilityService. Note that a view cannot be made its own child.

Java documentation for android.view.accessibility.AccessibilityNodeInfo.addChild(android.view.View).

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.

Applies to