因此,对于我的应用,我正在尝试启用完整的VoiceOver辅助功能支持。大多数工作正常,但我遇到了一些UITableViews的问题。这些表具有节标题并设置为UITableViewStylePlain,因此节标题将显示在列表的顶部。这一切都非常适合普通用户,但对于启用了VoiceOver的用户,我遇到了一些问题。目前,当滚动到下一页时,某些元素似乎显示在该部分的标题下方,这使得它们几乎无法选择。到目前为止,我还无法确定这是否实际上是预期的行为,以及我是否可以在不删除标题的情况下解决此问题。
如果我将标题高度设置为0并确保UITableView本身不受限制,我已经验证滚动工作正常。因此,我最好的结论是节标题显示在列表元素的顶部,因此被该节遮挡。
举例说明:
滚动前
=-=-=-=-=-=-=-=-=-=-=-=-= (start of list)
Section Header
.........................
Elem 1
.........................
Elem 2
.........................
=-=-=-=-=-=-=-=-=-=-=-=-= (end of list)
滚动后:
=-=-=-=-=-=-=-=-=-=-=-=-=
Section Header (Elem 3 is here)
.........................
Elem 4
.........................
Elem 5
=-=-=-=-=-=-=-=-=-=-=-=-=
如果我的代码是相关的:
- (UIView *)tableView: (UITableView *) tableView viewForHeaderInSection: (NSInteger) section
{
UIView *headerView = [UIView new];
UIView *containerView = [UIView new];
// Add stuff to container View
headerView.frame = CGRectMake( 0.00f, 0.00f, tableView.frame.size.width, someHeight);
headerView.backgroundColor = [UIColor whiteColor];
containerView.frame = headerView.frame;
[headerView addSubview: containerView];
containerView.isAccessibilityElement = true;
containerView.accessibilityLabel = accessibilityLabel;
headerView.isAccessibilityElement = false;
return headerView;
}
- (CGFloat) tableView: (UITableView *) tableView heightForHeaderInSection: (NSInteger) section
{
return someHeight;
}
那么,任何人都知道如何在不完全重写分区逻辑的情况下解决这个问题吗?