X $ C $çUIAutomation不能与TTTAttributedLabel互动 [英] Xcode UIAutomation can't interact with TTTAttributedLabel

查看:222
本文介绍了X $ C $çUIAutomation不能与TTTAttributedLabel互动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着写我的应用程序自动化脚本,我的问题是,是X code UI自动化只是看不见的 TTTAttributedLabel 类。获得全要素树显示没有那些 TTTAttributedLabel 元素的迹象。我用X code 6.1.1

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

推荐答案

默认情况下 TTTAttributedLabel 不是一个辅助因素。它可以作为定制的容器,并提供可访问的链接/手机和其他检测到的数据。
要改变这种行为的子类 TTTAttributedLabel 和重写方法 UIAccessibilityElement 的协议。

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.

例如。返回 - (BOOL)isAccessibilityElement 方法和 TTTAttributedLabel 将作为的UILabel

E.g. return YES in -(BOOL)isAccessibilityElement method and TTTAttributedLabel will work as UILabel

这篇关于X $ C $çUIAutomation不能与TTTAttributedLabel互动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆