虽然常量contentDescription
适用于某些小部件,但其他情况(例如带有标题的图片库)已经在 UI 中具有适当的可访问性标签。有没有办法将ImageView
'scontentDescription
与其Textview
在 XML 中的标签联系起来?
例如,此ImageView
定义的最后(虚构)行是否存在真正的等价物:
<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>