用CoreText实现类似微博那样可以点击的Label
2017-04-02 00:00
309 查看
JLLabel
用CoreText实现类似微博那样可以点击的文字,自动识别@,#,http(s)等特殊字符串,用法如下:JLLabel *contentLabel = [[JLLabel alloc] init]; contentLabel.font = [UIFont systemFontOfSize:15.0]; contentLabel.tapCallBack = ^(NSString *string,NSRange range,NSDictionary *info){ NSLog(@"点击的字符串是:%@",string); NSLog(@"点击的字符串的范围是:%@",[NSValue valueWithRange:range]); }; [self.contentView addSubview:contentLabel];
下载点击源代码
相关文章推荐
- iOS 像微博中可以点击连接、#text#、@somebody是如何做的,该怎样实现?
- WPF程序也可以很轻松的实现类似QQ那样最小化到任务栏的功能。
- iPhone开发-实现类似微博那样在敲入“@”字符之后加入自动提示功能
- 实现类似微博@..的点击文字跳转事件 iOS
- 通过YYtext实现文本点击(类似微博效果)
- 用jQuery实现图片预加载和等比例缩小,大图可以点击关闭
- 类似msn可以弹出提示框,同时可以点击连接
- 有一个table表格,选中某一行后,点击“查看(button)”按钮可以实现对该行内容的显示
- richTextBox如何实现输入指定的字符显示一个表情图标?类似QQ那样?
- [原创][代码]类似IE设置代理服务器那样的数据快速批量操作业务的实现
- adroid 类似QQ,点击输入框外面可以消失软键盘
- 用jQuery实现图片预加载和等比例缩小,大图可以点击关闭
- 通过点击Item的图标可以实现对可执行文件的调用
- [更新]Windows Phone 实现类似“微博”下拉刷新效果
- 实现类似路由器那样通过WEB页面配置设备
- Java拼图源码,就像美图秀秀、发微博那样可以拼长图
- 谁能用jQuery和Ajax做的访问ado.net程序-----跪求各位大侠(有相似的也可以,只要实现的是类似的功能就可以)
- 最近被一个问题困扰着,如何实现类似Photoshop的多层图像操作,每层可单独操作,又可以组合显示出来。
- 用jQuery实现图片预加载和等比例缩小,大图可以点击关闭
- 实现一个类似3dmax那样的鼠标移动物体操作