Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试为我的应用程序编写自动化脚本,我的问题是 Xcode UI 自动化只是看不到TTTAttributedLabel类的元素。TTTAttributedLabel获取完整元素树没有显示这些元素的迹象。我正在使用 Xcode 6.1.1
TTTAttributedLabel
默认情况下TTTAttributedLabel不是可访问性元素。它用作自定义容器,并为链接/电话和其他检测到的数据提供可访问性。更改此行为的子类TTTAttributedLabel并覆盖UIAccessibilityElement协议的方法。
UIAccessibilityElement
例如YES在-(BOOL)isAccessibilityElement方法中返回TTTAttributedLabel并将作为UILabel
YES
-(BOOL)isAccessibilityElement
UILabel