NSAttributedString 多格式字符串
2024-09-18 17:36:12
NSString *aString = @"哈哈标题(必填)";
NSRange range = NSMakeRange(4, 4);
//当然也可以查找NSRange range = [aString rangeOfString:@"(必填)"];
NSMutableAttributedString *tempString = [[NSMutableAttributedString alloc] initWithString:aString];
[tempString addAttribute:NSForegroundColorAttributeName value:[UIColor grayColor] range:range];
除了
NSForegroundColorAttributeName 颜色,还有其他属性
NSFontAttributeName 字体UIFont
NSParagraphStyleAttributeName 段落风格等...
其他的自己可以去找找看看
最新文章
- [更新设计]跨平台物联网通讯框架ServerSuperIO 2.0 ,功能、BUG、细节说明,以及升级思考过程!
- CDH离线数据导入solr:利用MapReduceIndexerTool将json文件批量导入到solr
- FilterControl 显示时间并精确到时分秒的方法
- 山东省选 郁闷的小J
- ubuntu14.04下配置使用openCV3.0
- Two-Phase Commit (两阶段提交)
- search in 2d matrix and serach minimum in rotated array
- PYTHON多进程并发WEB服务器(利用LINUX的FORK)
- CMOS Sensor的调试经验分享
- Linux动态库的编译与使用
- VS2008生成的程序无法在其它电脑上运行,提示系统无法执行指定的程序
- PHP安装和配置
- (转)OpenGL中位图的操作(glReadPixels,glDrawPixels和glCopyPixels应用举例)
- C#之简单选择排序
- 理解iOS 8中的Self Sizing Cells和Dynamic Type
- Upgrade Ver 4.3.x from 4.2.x
- 安卓TextView限定行数最大值,点击按钮显示所有内容
- CSS3动画--过渡效果
- OI用语一览表
- echo与print,var_dump()和print_r()的区别
热门文章
- 将IoTdb注册为Windows服务
- pycham debug 专辑
- Array.from() ------来自❀ 前端宇宙 ❀公众号。
- STL关联式容器使用注意、概念总结
- python导入和导出excel,以文件流形式返回前端
- P22_条件渲染
- P20_事件绑定
- 接入jira OAuth权限流程
- git操作出现 error: The following untracked working tree files would be overwritten by ...
- 微信小程序wxs封装使用以及公共js组件封装