代码之家  ›  专栏  ›  技术社区  ›  Rahul Sharma zaph

可访问性:相关内容-两指轻弹

  •  2
  • Rahul Sharma zaph  · 技术社区  · 8 年前

    TV OS Accessibility

    我一直在试图理解使用“右二指轻弹”的意图和潜在用例,如苹果电视上“语音帮助”部分所述。到目前为止,我的理解是

    • 在附加屏幕截图的情况下,用户可以获得对焦菜单选项的提示,并了解有关该选项的更多信息(在这种情况下,它将在Apple TV徽标下显示为“右二指轻弹”。

    enter image description here

    就可访问性属性而言,这就是我的代码目前的样子

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        guard let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath) as? AccessibilityTableViewCell else {
            return UITableViewCell()
        }
    
        cell.titleLabel.text = "Main title for row \(indexPath.row)"
        cell.titleLabel.textColor = .black
    
        cell.isAccessibilityElement = true
        cell.accessibilityLabel = "Main title for row \(indexPath.row)"
        cell.accessibilityHint = "Hint for Main title at row for index \(indexPath.row)"
        cell.accessibilityTraits |= UIAccessibilityTraitStaticText
    
        return cell
    }
    

    要将提示标签设置为与第2行相关的内容,还需要设置哪些附加内容?

    0 回复  |  直到 8 年前
    推荐文章