Setting contentDescription from label for android accessibility

Viewed 10362

While a constant contentDescription is appropriate for some widgets, other cases such as an image gallery with captions already have appropriate accessibility labels in the UI. Is there any way to link an ImageView's contentDescription with its labelling Textview in XML?

For example, is there a real equivalent for the last (fictional) line of this ImageView definition:

<LinearLayout>
    <ImageView
        android:id="@+id/image"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:contentDescription="@+id/label" />
    <TextView
        android:id="@+id/label"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
</LinearLayout>
1 Answers
Related