我有一个包含一堆subViews的UIView。其中之一是UILabel,它可能包含一个或两个链接。
我想让画外音读取我为视图设置的任何内容,但允许用户将rotor更改为Links。用户可以向上和向下滑动不同的链接。
我知道Links本身就可以与UIWebView一起工作,但我找不到任何关于它的文档,无论这是否可能。我也在研究UITextView,但这是最后的办法,因为如果我进行切换,我有很多遗留代码需要删除。
发布于 2015-02-26 22:49:16
不幸的是,你不能添加一个项目到转子,但是从iOS8开始,你可以添加一个UIAccessibilityCustomAction,允许用户在转子中选择一个“动作”。然后用户可以向上滑动以选择您的项目,然后双击以激活该项目。
下面是如何添加UIAccessibilityCustomAction的方法:
UIAccessibilityCustomAction *customAction = [[UIAccessibilityCustomAction alloc] initWithName:@"Next link" target:self selector:@selector(nextLink:)];
NSMutableArray *customActions = [NSMutableArray arrayWithArray:self.accessibilityCustomActions];
[customActions addObject:customAction];
self.accessibilityCustomActions = customActions;然后,您可以跟踪您的链接,并允许用户在nextLink:方法中导航。
https://stackoverflow.com/questions/28593043
复制相似问题