Ga naar hoofdinhoud
Logo Appt Light

Accessibility role on iOS

An accessibility role helps users of assistive technologies to understand the purpose of elements on the screen. The role button for example, indicates that an action will be performed on activation. The screen reader announces the role of elements as it reads the screen. It is important to assign correct roles to elements to avoid misunderstanding.

Op iOS wordt het accessibilityTraits attribuut gebruikt om de rol te bepalen. Je kunt bijvoorbeeld de rol “knop” instellen met de button trait. Of stel de rol “link” in via de link trait. Alle mogelijk waardes kun je bij UIAccessibilityTraits bekijken.

element.accessibilityTraits = .button
element.accessibilityTraits = .header
element.accessibilityTraits = .link
element.accessibilityTraits = .image

element.accessibilityTraits = [.button, .selected]
Bijdragen

Feedback?

Laat 't ons weten!