简体   繁体   English

iOS 6 UITextView链接检测问题

[英]iOS 6 UITextView Link Detection Issue

I am coming across a strange bug in my app, that I believe is an iOS 6 bug. 我在应用中遇到一个奇怪的错误,我相信是iOS 6的错误。

I have a UITextView that contains some text that has some links and phone numbers. 我有一个UITextView,其中包含一些带有一些链接和电话号码的文本。 In my storyboard, I have Links & Phone Numbers checked under 'Detection' for my UITextView. 在我的情节提要中,我的UITextView的“检测”下的“链接和电话号码”已选中。 In code I also do: 在代码中,我也这样做:

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

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. 我遇到的问题很奇怪,但是当我从Xcode将我的应用程序运行到我的设备(或sim)上时,UITextView可以很好地检测所有链接,我可以单击它们。 If I then run the app not in debug (not running through Xcode), the links show as black standard text and cannot be touched. 如果然后我以非调试方式运行应用程序(未通过Xcode运行),则链接显示为黑色标准文本,无法触摸。 Note this is only happening on iOS 6. 请注意,这仅在iOS 6上发生。

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 5模拟器上,无论应用程序是在调试中运行还是从模拟器中运行,链接均显示为蓝色且可以单击。

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? 有谁知道iOS 6中是否有特定更改? 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. 我的意思是,就像我说的那样,当它直接从Xcode运行时,它会检测到链接,所以对我来说,这似乎是一个iOS 6错误。

Any help is appreciated! 任何帮助表示赞赏!

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的Storyboard中的UITableView的页脚中。

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. 该修复程序很愚蠢...我从UIView中删除了UITextView,只是将其用作页脚(我在某一位置在页脚中具有多个textview),并且开始检测链接。

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. 但我仍然相信这是一个错误-因为如果您确实需要使用UIView,则不会从其中的textview中检测到链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM