简体   繁体   中英

UITextView responding unexpected to accessibility voice over

Currently I am walking through my whole iOS app to optimize it for accessibility voice over. When it comes to the UITextView, which I subclassed, voice over is not acting like I thought it would. My UITextView subclass is only changing a path's color on the superview's layer in becomeFirstResponder and resignFirstResponder. So nothing special on my UITextView subclass that could interfere with accessibility.

As long as there is no text in the UITextView it is acting as expected. Voiceover tells me that it is a text field and that I can double tap it to edit. But as soon as there is text in the UITextView, the only thing voice over tells me, is the value of the UITextView. Voice over doesn't tell me anymore that this is an editable text field.

Am I doing something wrong? Why is it acting like that?

I do appreciate any help!

If you didn't edit any accessibility hints or labels for the text field it should act accordingly. If selected it should say:

  1. It is a text field
  2. If you are editing it
  3. The editing mode you are in
  4. The value of the text field (nil if empty)
  5. Where the cursor is

Then while you type it says the letters you are entering as you enter them. When you hit space or enter it should say the word you just typed. As long as your text field is exhibiting these behaviors you should be fine.

Tip: if you want to know how accessibility elements should act, try using a native iOS app with accessibility turned on and compare it with your app.

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