Voice Over 使用总结

本文总结了iOS平台上Voice Over的使用经验,通过链接资料深入探讨了如何为iOS应用实现无障碍功能,包括时间标签的可达性、Voice Over的使用技巧以及开发者如何编程支持Voice Over,以提升视障用户的使用体验。
摘要由CSDN通过智能技术生成
1. 如果初始化UIBarButtonItem的时候,customView为UIButton的话,为UIBarButtonItem或UIButton设置accessibilityLabel均可;如果加了一层UIView做为UIButton的containerView,然后把这个containerView设置为UIBarButtonItem的customView,这个时候则只能对UIButton设置accessibilityLabel

案例:返回按钮的修改;其他页面rightbarbuttonitem的修改


2. 对于UITableViewCell,直接通过设置cell的accessibilityLabel属性来实现即可,可以将各个控件的accessibilityLabel组装成一行更加移动简单的文字返回。Apple官方的示例代码或者在自定义UITableViewCell的时候覆盖accessibilityLabel即可:
@implementation WeatherTableViewController
// This is a view that provides weather information. It contains a city subview and a temperature subview, each of which provides a separate label.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
    // set up the cell here...
    NSString *cityLabel = [self.weatherCity accessibilityLabel];
    NSString *temperatureLabel = [self.weatherTemp accessibilityLabel];
    // Combine the city and temperature information so that VoiceOver users can get the weather information with one gesture.
    [cell setAccessibilityLabel:[NSString stringWithFormat:@"%@, %@", cityLabel, temperatureLabel]];
    return cell;
}
@end
参考资料:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值