iOS 6 UITextView Link Detection Issue

独自空忆成欢 提交于 2019-12-11 19:08:00

问题


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

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;

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.

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.

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.

Any help is appreciated!


回答1:


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.

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.

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.



来源:https://stackoverflow.com/questions/13350971/ios-6-uitextview-link-detection-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!