iOS 7 中的 UITextView 链接检测 [英] UITextView link detection in iOS 7

查看:22
本文介绍了iOS 7 中的 UITextView 链接检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过 Interface Builder 管理的 UITextView.作为数据检测,我检查了链接".在 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 是容器视图的子视图,它再次位于 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屋!

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