UITextView学习记录
来源:互联网 发布:大学生网络诈骗感悟 编辑:程序博客网 时间:2024/05/17 23:22
介绍:点击打开链接
设置带特殊属性的文本:
NSRange highlightedRange = [text rangeOfString:NSLocalizedString(@"highlighted", nil)];// 获取设置的文本范围[attributedText addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:underlinedRange];// 设置
设置带图片的文本:
NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];UIImage *imageAttachment = [UIImage imageNamed:@"/Users/npu_wy/Desktop/image2/image9.png"];textAttachment.image = imageAttachment;textAttachment.bounds = CGRectMake(0, 0, imageAttachment.size.width, imageAttachment.size.height);NSAttributedString *textAttachmentString = [NSAttributedString attributedStringWithAttachment:textAttachment];[attributedText appendAttributedString:textAttachmentString];设置:
textView.attributedText = attributedText;
attributedText-> textAttachmentString -> textAttachment -> imageAttachment
0 0
- UITextView学习记录
- UITextView的使用记录
- ios学习--UItextview
- OC学习之UITextView
- UITextView头文件学习
- ios学习笔记-Lecture5:UITextView
- iOS 客户端学习-UITextView
- iOS学习之----------自定义UITextView
- iOS之UI学习-UITextView
- UITextView
- UITextView
- UITextView
- UITextView
- UITextView
- UITextView
- UITextView
- UITextView
- UITextView
- 嘻唰唰第四批之学生信息的输入输出
- 008.Enum 枚举型
- CoreAnimation编程指南(简介)
- 1010. Radix (25)
- 快速排序
- UITextView学习记录
- 黑马程序员--Foundation
- intellij IDEA序列号
- Tomcat搭建文件服务器
- poj1273
- MySQL版本查询以及生成的数据表文件路径
- SQL-T-SQL语句
- 009.BOOL 布尔类型
- vpn报错:OpenVPN for Win32 "All TAP-Win32 adapters on this system are currently in use"