What's the difference between setAccessibilityLabel and accessibilityIdentifier in ios?

前端 未结 4 446
感情败类
感情败类 2021-01-31 14:32

I\'ve been going through our code base and setting the accessibilityIdentifier property on all of our buttons and text fields so that I can access them using UIAutomation. While

4条回答
  •  再見小時候
    2021-01-31 15:14

    AccessibilityLabel is the value that’s read by VoiceOver to the end-user. As such, this should be a localized string. The text should also be capitalized. Because this helps with VoiceOver’s pronunciation. accessibilityLabel is used for testing and Visual Impaired users.

    AccessibilityIdentifier identifies an element via accessibility, but unlike accessibilityLabel, accessibilityIdentifier's purpose is purely to be used as an identifier for UI Automation tests. We use a value for testing process.

提交回复
热议问题