textView在tableViewcell中复用问题,复用时超链接也出现复用,超链接出现在不该出现的文字上
2015-11-04 16:28
381 查看
说明:标题写的长是方便大家检索到,增加一次性搜索的概率
tableviewcell中有一个textview,textview的超链接识别是打开的,
UIDataDetectorTypeLink,那么大量的cell重用后,超链接出现在不是网址的文字上
解决办法是在赋值text的时候先付给nil清空上一个,然后拼接\u200B在前面
语法如下
Objective C: textView.text = [@"\u200B" stringByAppendingString:message.content];
None of these answers worked for me (iOS8, Swift), the only thing that worked for me was to first set the text to
出处stackoverflow:
http://stackoverflow.com/questions/19121367/uitextviews-in-a-uitableview-link-detection-bug-in-ios-7/19589680#19589680
tableviewcell中有一个textview,textview的超链接识别是打开的,
UIDataDetectorTypeLink,那么大量的cell重用后,超链接出现在不是网址的文字上
解决办法是在赋值text的时候先付给nil清空上一个,然后拼接\u200B在前面
语法如下
Objective C: textView.text = [@"\u200B" stringByAppendingString:message.content];
None of these answers worked for me (iOS8, Swift), the only thing that worked for me was to first set the text to
niland then prepend the new text with a non-visibile whitespace unicode character (I chose
\u200B, which is the ZERO WIDTH SPACE character but any character works):
出处stackoverflow:
http://stackoverflow.com/questions/19121367/uitextviews-in-a-uitableview-link-detection-bug-in-ios-7/19589680#19589680
相关文章推荐
- jquery事件绑定
- SASS用法指南
- iOS远程推送
- Java设计模式----命令模式(Command)
- 彻底弄明白之java多线程中的volatile
- SQLite数据库的使用总结
- 单例模式
- Java设计模式----命令模式(Command)
- EditTex
- centos7安装配置jetty
- String 和StringBuffer的区别
- 好看的css3样式在线生成工具
- 分条发送短信
- Codevs_P1080 线段树练习(树状数组)
- 简单的b表数据更新到a表列
- 模式识别综述
- C/C++面试小知识点
- ASP.NET权限管理系统(FrameWork) 1.0.7
- linux c语言字符串函数replace,indexOf,substring等的实现
- Java环境变量配置