setLabeledBy

open fun setLabeledBy(label: View)(source)

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

Parameters

label

The view that labels this node's source.


open fun setLabeledBy(root: View, virtualDescendantId: Int)(source)

Sets the view which serves as the label of the view represented by this info for accessibility purposes. If virtualDescendantId is NO_ID the root is set as the label.

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.

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

Parameters

root

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

virtualDescendantId

The id of the virtual descendant.