简体   繁体   中英

Focus on element to read by VoiceOver/TalkBack

As I am developing an App with React Native, I'm trying to make it accessible using VoiceOver/TalkBack.

In my code, I have a boolean value that tracks whether an operation happened or not. Depending on the value of this boolean variable, I show in my view either Text1 or Text2. I want to notify the user when this modification happens.

How can I proceed? I have read the documentation here: https://reactnative.dev/docs/accessibility and don't seem to have a function for that for both iOS/Android.

If you want to notify screen readers about a change, then use a live region, https://reactnative.dev/docs/accessibility#accessibilityliveregion-android , although it looks like that property is just for Android.

Seems like react would have it for both platforms because native iOS supports it via UIAccessibilityPostNotification when you pass it UIAccessibilityAnnouncementNotification .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM