Język

AccessibilityNodeInfo.AddLabeledBy Method

Definition

Overloads

Name Description
AddLabeledBy(View)

Adds the view which serves as the label of the view represented by this info for accessibility purposes.

AddLabeledBy(View, Int32)

Adds the view which serves as the label of the view represented by this info for accessibility purposes.

AddLabeledBy(View)

Adds the view which serves as the label of the view represented by this info for accessibility purposes.

[Android.Runtime.Register("addLabeledBy", "(Landroid/view/View;)V", "GetAddLabeledBy_Landroid_view_View_Handler", ApiSince=36)]
public virtual void AddLabeledBy(Android.Views.View label);
[<Android.Runtime.Register("addLabeledBy", "(Landroid/view/View;)V", "GetAddLabeledBy_Landroid_view_View_Handler", ApiSince=36)>]
abstract member AddLabeledBy : Android.Views.View -> unit
override this.AddLabeledBy : Android.Views.View -> unit

Parameters

label
View

A view that labels this node's source.

Attributes

Remarks

Adds the view which serves as the label of the view represented by this info for accessibility purposes. When multiple labels are added, the content from each label is combined in the order that they are added.

If visible text can be used to describe or give meaning to this UI, this method is preferred. For example, a TextView before an EditText in the UI usually specifies what information is contained in the EditText. Hence, the EditText is labeled by the TextView.

Android reference for android.view.accessibility.AccessibilityNodeInfo.addLabeledBy.

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

AddLabeledBy(View, Int32)

Adds the view which serves as the label of the view represented by this info for accessibility purposes.

[Android.Runtime.Register("addLabeledBy", "(Landroid/view/View;I)V", "GetAddLabeledBy_Landroid_view_View_IHandler", ApiSince=36)]
public virtual void AddLabeledBy(Android.Views.View root, int virtualDescendantId);
[<Android.Runtime.Register("addLabeledBy", "(Landroid/view/View;I)V", "GetAddLabeledBy_Landroid_view_View_IHandler", ApiSince=36)>]
abstract member AddLabeledBy : Android.Views.View * int -> unit
override this.AddLabeledBy : Android.Views.View * int -> unit

Parameters

root
View

A root whose virtual descendant labels this node's source.

virtualDescendantId
Int32

The id of the virtual descendant.

Attributes

Remarks

Adds the view which serves as the label of the view represented by this info for accessibility purposes. If virtualDescendantId is View.NO_ID the root is set as the label. When multiple labels are added, the content from each label is combined in the order that they are added.

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 themselves as a tree of virtual views, thus conveying their logical structure.

If visible text can be used to describe or give meaning to this UI, this method is preferred. For example, a TextView before an EditText in the UI usually specifies what information is contained in the EditText. Hence, the EditText is labeled by the TextView.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Android reference for android.view.accessibility.AccessibilityNodeInfo.addLabeledBy.

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