0

我有一个项目在其托管活动打开时会窃取焦点。

但是在对讲模式下,它会被读取两次。

1)我如何定义一个项目,一旦它打开了活动就被阅读?

2)什么会导致其内容描述被阅读两次?

3)有没有办法定义点击后要阅读的内容描述?

我看到了这个文档,但没有找到答案。

4

2 回答 2

1

The question lacks some specifics, but here are some answers.

1 - The screen reader will automatically focus and read the first view on the screen (from right to left, top to bottom). This is the default behavior and should not be changed.

2 - In some cases, the screen reader may perform a different action when your content is shown. For example, when a Dialog is shown, the default behavior for TalkBack is to announce the title and focus on the second view. If you are manually requesting the reader to focus on the title, it may be read twice.

3 - You can define the text to be read in your XML with android:contentDescription, or in your code with view.setContentDescription(textToRead)

于 2019-05-12T00:06:32.280 回答
0

看起来如果外部容器是“可聚焦的”,那么它可能会两次宣布内容。例如:

<FrameLayout focusable='true'>
    <TextView/>
</FrameLayout>

所以,对我来说,解决方法是让外部容器“不可聚焦”

于 2020-09-08T18:24:21.527 回答