我有以下(相当标准的)观点。ImageView和android:contentDescription是其中的重要组成部分。我的问题只涉及可访问性特性。
ImageView是默认的:android.widget.ImageView
android:contentDescription设置为“我的酷狗”,系统通过Android Talkback读取(说话)完全相同:“我的酷狗”。
我想要它读:“我的酷狗图像”。如何将“图像”后缀添加到对讲机的消息中?
理想情况下,我希望有一些类似于context.getString(android.R.string.accessibility_button)的东西,它可以本地化到特定的语言。
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data></data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/welcome_image"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:contentDescription="@{viewModel.imageAccessebilityDescription}"
app:imageRes="..." />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>发布于 2020-01-30 17:37:26
很多上下文信息都是通过“嘟嘟”、“砰”等方式传递给用户的,你可能没有注意到。这就是为什么你没有听到它是一个图像。
你不应该在描述的末尾加上“图像”。您必须记住,有一些BrailleBack用户不需要这些额外的信息,这实际上会降低这些用户的可访问性(假设有几个图像一个接一个,他们会读取的图像,我的酷狗,图像,图像,另一个酷狗,图像‘。这会让人感到困惑,他们是否漏掉了一张图片,有多少张图片,等等。
现在,如果你想让一个可以接受的contentDescription变得更清楚,那就是‘--我的酷狗’ vs 'my酷狗的照片,至少对所有用户来说,这是有意义的。
虽然不太理想,但你可以利用这一点来描述图像的风格,比如 'a information of .‘,a a to of.,一张.的画.的照片等等。至少这样你不会添加完全不需要的信息,即使在现实中TalkBack在这里应该做得更好。
我知道这会使i18n等自动化变得更加困难,但这将提供更好的体验,并且能够兼容WCAG。相反,我只需要为每种语言切换整个contentDescription。
https://stackoverflow.com/questions/59991294
复制相似问题