0

这是我的代码。我添加了领先视图和信息按钮的可访问性,但语音仍然不是说信息按钮。信息按钮和主视图是可访问的元素。

let infoIconButton = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: 15, height: 15))
infoIconButton.contentMode = .scaleAspectFill
infoIconButton.addTarget(self, action: #selector(infoButtonPressed(button:)), for: .touchUpInside)
infoIconButton.accessibilityLabel = "Icon button"
infoIconButton.setImage(UIImage.init(named: "iconu", in: nil, compatibleWith: nil), for: .normal)
            
textField.leadingViewMode = .always
textField.leadingView = infoIconButton
textField.leadingView?.isAccessibilityElement = true
textField.leadingView?.accessibilityTraits = .button
textField.leadingView?.accessibilityLabel = "Icon button"

4

0 回答 0