setLabelFor

open fun setLabelFor(labeled: View)(source)

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

Parameters

labeled

The view for which this info serves as a label.


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

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

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.

Parameters

root

The root whose virtual descendant serves as a label.

virtualDescendantId

The id of the virtual descendant.