UITextView:在模拟器中工作的链接检测,而不是在设备上 [英] UITextView: Link detection working within Simulator, not on device

查看:17
本文介绍了UITextView:在模拟器中工作的链接检测,而不是在设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 UITextViews 包含数据,这些数据应该被数据检测识别,但是虽然一个在设备和模拟器上都可以正常工作,但有一个只能在模拟器下工作.我曾尝试从我的设备中删除构建,清理产品,删除派生数据,但似乎没有任何方法可以解决不一致的问题.

I've got two UITextViews containing data that should be recongised by the data detection, however whilst one works fine on both device and simulator there's one that only works under Simulator. I've attempted trashing the build from my device, cleaning the product down, removing derived data and nothing seems to resolve the inconsistency.

在 Interface Builder 中启用了链接检测,数据使用 NSString stringWithFormat: 格式的字符串传入,并使用 UITextView setText: 进行设置.为两者设置相同的方式,所以那里没有区别,但它似乎对其中之一无法正常工作.

Link detection was enabled within Interface Builder, the data is passed in with a NSString stringWithFormat: formatted string and set with UITextView setText:. Set the same way for both, so there's no difference there, but it just doesn't seem to work correctly for one of them.

在设备上,如果我点击应检测为链接的项目之一,它会变成蓝色并进行链接检测.我没有设置任何可能会产生影响的自定义字体或颜色.

On the device if I tap on one of the items that should detect as a link, it'll then turn blue and do link detection. I'm not setting any custom fonts or colours that could have an impact.

推荐答案

看来诀窍是 setScrollable:NO.似乎解决了问题,但如果您需要滚动,我不确定答案是什么...

It appears that the trick is to setScrollable:NO. Seems to fix the problem, although if you need scrolling, I'm not sure what the answer will be...

这篇关于UITextView:在模拟器中工作的链接检测,而不是在设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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