3

我们有一个UITextView包含两个嵌入链接的属性字符串,这些链接是通过使用在文本视图中创建的NSLinkAttributeName。我们正在使用 Calabash 进行自动化测试,而 Calabash 不能“点击”这些 TextView 内部的链接。有什么我遗漏的东西使这些链接可以在UITextView自动化/可访问性工具中点击吗?

用户可以点击这些链接,并确认预期的委托回调正在工作。唯一不起作用的情况是使用辅助工具尝试点击UITextView.

以供参考:

 NSDictionary *plainAttributes = [self plainTextAttributes];
 NSDictionary *linkAttributes = [self linkAttributes];
 NSMutableDictionary *linkOneAttributes = [linkAttributes mutableCopy];
 termsOfUseAttributes[NSLinkAttributeName] = @"linkOne";
 NSMutableDictionary *linkTwoAttributes = [linkAttributes mutableCopy];
 privacyPolicyAttributes[NSLinkAttributeName] = @"linkTwo";

 NSMutableAttributedString *string = [NSMutableAttributedString new];
 [string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Blah blah blah blah " attributes:plainAttributes]];
 [string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Link One" attributes:linkOneAttributes]];
 [string appendAttributedString:[[NSAttributedString alloc] initWithString:@". Blah blah blah blah" attributes:plainAttributes]];
 [string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Link Two" attributes:linkTwoAttributes]];
 [string appendAttributedString:[[NSAttributedString alloc] initWithString:@"." attributes:plainAttributes]];

非常感谢在使用NSLinkAttributeNamein的属性字符串时对可访问性的任何见解。UITextView

4

1 回答 1

0

Well, if the acessibility doesn't work automatically and I think it should work automatically, then your only change is to override UIAccessibilityContainer methods for that UITextView.

Are you sure you have accessibility enabled for that view?

于 2014-05-05T21:59:05.280 回答