【发布时间】:2020-08-19 09:03:55
【问题描述】:
现在,当应用的新 Beta 版上传到 Play 商店时,Google 会提供“发布前报告”。我上一份发布前的报告包含一个完整的对话框,里面充满了“多个项目具有相同的描述”。我现在已经找出了在我的情况下是什么导致了问题和我的解决方案。仍然显示问题的对话框的简化布局如下:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/displayHeightLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/displayHeightLbl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="@string/displayInfoEms"
android:labelFor="@id/displayHeight"
android:text="@string/displayHeightLbl" />
<TextView
android:id="@+id/displayHeight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="@string/displayInfoEms" />
</LinearLayout>
<Button
android:id="@+id/displayInfoOkBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="dismissDisplayInfos"
android:text="@string/btnOk" />
</LinearLayout>
</ScrollView>
Google 文档建议安装 TalkBack 和 Accessibility Scanner,这使我能够测试和重现问题。解决方案记录如下。
【问题讨论】:
标签: android accessibility android-dialog android-accessibility