iOS 7中的UITextView链接检测 [英] UITextView link detection in iOS 7
问题描述
我有一个 UITextView
,它通过Interface Builder进行管理。作为数据检测,我检查了链接。在iOS 6中,一切正常,链接突出显示且可点击。但是在iOS 7中,所有链接都只是纯文本。未选中可编辑和可选择的复选框。
I have a UITextView
which is managed via Interface Builder. As data detection I have "Links" checked. In iOS 6 everything is working fine and links are highlighted and are clickable. In iOS 7 though, all links remain just plain text. The editable and selectable checkboxes are unchecked.
可能引起关注的是 UITextView
是a的子视图容器视图,它再次位于 UIScrollView
中。
What may be of concern is that the UITextView
is a subview of a container view which is again inside a UIScrollView
.
推荐答案
似乎在iOS 7中链接检测仅在 UITextView
是可选择的。因此,使我的 UITextView
无法选择会阻止链接检测工作。
It seems that in iOS 7 link detection only works if the UITextView
is selectable. So making my UITextView
not selectable stopped the the link detection from working.
我还在iOS 6中对此进行了测试,我可以确认在iOS 6中链接检测工作正常,即使使用 UITextView
不可选择。
I also tested this in iOS 6 and I can confirm that in iOS 6 the link detection works fine even with the UITextView
not being selectable.
这篇关于iOS 7中的UITextView链接检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!