[英]iOS Accessibility: make UITextField and specified subview accessible
[英]Make UIButton accessible (accessibility) in tableview header
我似乎找不到与我有相同问题的人。 我所有的tableview单元格都很好地实现了可访问性,但是我的标题似乎没有。 我在标题视图中有一个按钮,该按钮对辅助功能不起作用...有人可以帮我吗?
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIButton *button = [[[UIButton alloc] initWithFrame: CGRectMake(282, 10, 28, 28)] autorelease];
button.isAccessibilityElement = TRUE;
button.titleLabel.text = @"Informatie";
[button addTarget:self action:@selector(infoButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:button];
}
我意识到我对此措辞很糟糕。 我的意思是,该按钮可以正常使用,仅适用于在手机上启用了辅助触摸的用户。 电话没有以帮助残障用户摆脱困境的声音“出现”。 而且我确实收到了日志错误“ AX错误:找不到我的模拟父母,很可能是我过时了。”
您不应该通过直接修改标签的文本来设置按钮的标题。 而是使用setTitle:forState:
例如:
[button setTitle:@"Informatie" forState:UIControlStateNormal];
同样,按钮通常使用类方法buttonWithType:
而不是alloc
/ initWithFrame:
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.