gpt4 book ai didi

ios - 如何将 `accessibilityLabel` 添加到 `UIAlertView` 按钮?

转载 作者:可可西里 更新时间:2023-11-01 03:46:56 25 4
gpt4 key购买 nike

如何将 accessibilityLabel 添加到 UIAlertView 按钮?

UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Announcement" 
message: @"message!"
delegate: nil
cancelButtonTitle: @"cancelButton"
otherButtonTitles: @"otherButton"];

[alert show];

最佳答案

根据 Apple's documentation (搜索“使警报 View 可访问”),警报 View 是“默认可访问的”。这一点以及按钮不可编辑的事实意味着您可能不应该尝试自己更改 accessibilityLabel。默认情况下,他们使用按钮的标题和“按钮”一词,这应该没问题。

Accessibility for alert views pertains to the alert title, alert message, and button titles. If VoiceOver is activated, it speaks the word “alert” when an alert is shown, then speaks its title followed by its message if set. As the user taps a button, VoiceOver speaks its title and the word “button.” As the user taps a text field, VoiceOver speaks its value and “text field” or “secure text field.”

关于ios - 如何将 `accessibilityLabel` 添加到 `UIAlertView` 按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21457501/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com