iOS 6 UITextView链接检测问题 [英] iOS 6 UITextView Link Detection Issue

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

问题描述

我在我的应用程序中遇到一个奇怪的错误,我认为这是一个iOS 6错误。

I am coming across a strange bug in my app, that I believe is an iOS 6 bug.

我有一个UITextView,其中包含一些带有一些链接的文本和电话号码。在我的故事板中,我有链接&在检测下为我的UITextView检查了电话号码。在代码中我也这样做:

I have a UITextView that contains some text that has some links and phone numbers. In my storyboard, I have Links & Phone Numbers checked under 'Detection' for my UITextView. In code I also do:

_txtvFooter.editable = NO;
_txtvFooter.dataDetectorTypes = UIDataDetectorTypeAll;

我遇到的问题很奇怪,但当我将我的应用程序运行到我的设备上时(或者从Xcode开始,UITextView可以很好地检测所有链接,我可以点击它们。如果我然后运行应用程序不在调试(不通过Xcode运行),链接显示为黑色标准文本,无法触摸。请注意,这只发生在iOS 6上。

The issue I am having is a strange one, but when I run my app onto my device (or sim) from Xcode, the UITextView detects all of the links fine, and I can click them. If I then run the app not in debug (not running through Xcode), the links show as black standard text and cannot be touched. Note this is only happening on iOS 6.

在iOS 5模拟器上,链接显示为蓝色,无论应用程序是在调试中运行还是只是可点击的从模拟器运行。

On the iOS 5 simulator, the links show as blue and are clickable no matter if the app is run in debug, or just ran from the simulator.

我已经查看了整个互联网,无法找到解决方案或报告此问题的任何其他人。有谁知道iOS 6中的内容是否有变化?我的事情是,就像我说它直接从Xcode运行时检测到链接,所以对我来说这似乎是一个iOS 6的错误。

I have looked all over the internets, and cannot find a solution or anyone else who has reported this issue. Does anyone know if something changed in iOS 6 specifically? I thing is, like I said it detects the links when run straight from Xcode, so to me it seems like an iOS 6 bug.

任何帮助表示赞赏!

推荐答案

我找到了导致我的问题的原因。我正在做的是将UIView放在Storyboard中包含UITextView的UITableView的页脚中。

I found what was causing my issue. What I was doing was placing a UIView in the footer of a UITableView in Storyboard that contained a UITextView.

修复程序很笨......我从UIView中删除了UITextView并且只是将其用作页脚(我在页脚中有多个文本视图)并且链接开始检测。

The fix was dumb... I removed the UITextView from the UIView and just used that as the footer (I at one point had multiple textviews in the footer) and the links began detecting.

我仍然相信这是一个bug但是 - 因为如果您确实需要使用UIView,则链接将无法从其中的文本视图中检测到。

I still believe this is a bug though-- because if you do need to use a UIView the links would not detect from the textviews within.

这篇关于iOS 6 UITextView链接检测问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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