I'm trying to write automation scripts for my app and my problem is that Xcode UI Automation just can't see the elements of TTTAttributedLabel
class. Getting full elements tree shows no sign of those TTTAttributedLabel
elements. I'm using Xcode 6.1.1
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
By default TTTAttributedLabel
isn't an accessibility element. It works as custom container and provides accessibility for links/phones and other detected data.
To change this behaviour subclass TTTAttributedLabel
and override methods of UIAccessibilityElement
protocol.
E.g. return YES
in -(BOOL)isAccessibilityElement
method and TTTAttributedLabel
will work as UILabel