属性字符串NSMutableAttributedString使用例子 -- iOS开发
来源:互联网 发布:linux last reboot 编辑:程序博客网 时间:2024/05/02 04:22
这是效果图:简单实现,一目了然
NSDictionary *publicAttrDict_base =@{NSFontAttributeName : [UIFontsystemFontOfSize:14.0f],NSForegroundColorAttributeName :[UIColordarkGrayColor]};
NSString *titleString = [NSStringstringWithFormat:@"参与人:%d人", [[_body objectForKey:@"AttendeeCount"]intValue]];
NSMutableAttributedString *titleAttributeString = [[NSMutableAttributedStringalloc]initWithString:titleStringattributes:publicAttrDict_base];
[titleAttributeStringaddAttribute:NSForegroundColorAttributeNamevalue:[UIColorgrayColor] range:NSMakeRange(0,4)];
cell.titleLabel.attributedText = titleAttributeString;
NSString *rightString = [NSStringstringWithFormat:@"实到:%d人", [[_body objectForKey:@"SignCount"]intValue]];
NSMutableAttributedString *rightAttributeString = [[NSMutableAttributedStringalloc]initWithString:rightStringattributes:publicAttrDict_base];
[rightAttributeStringaddAttribute:NSForegroundColorAttributeNamevalue:[UIColorgrayColor] range:NSMakeRange(0,3)];
cell.rightLabel.attributedText = rightAttributeString;
- 属性字符串NSMutableAttributedString使用例子 -- iOS开发
- iOS属性字符串NSMutableAttributedString
- iOS NSMutableAttributedString字符串属性
- NSMutableAttributedString 属性字符串的使用
- IOS开发-NSMutableAttributedString 富文本的使用
- 带属性的字符串(NSMutableAttributedString)的使用
- 带属性的字符串(NSMutableAttributedString)的使用
- IOS 中自定义字符串,又叫属性字符串NSMutableAttributedString
- ios 开发关于NSMutableAttributedString的使用
- iOS开发中有关NSMutableAttributedString的使用
- NSMutableAttributedString控制字符串的属性
- iOS NSMutableAttributedString 使用详解
- iOS NSMutableAttributedString 使用详解
- 【iOS开发】NSAttributedString和NSMutableAttributedString
- iOS开发 ☞ NSMutableAttributedString详解
- 带属性的字符串 NSMutableAttributedString/NSAttributedString
- 带属性的字符串 NSMutableAttributedString/NSAttributedString
- 关于NSMutableAttributedString属性字符串的用法
- java ssh框架中定时任务的使用
- springmvc + mybatis多数据源配置
- redis安装及学习(待续)
- 简单的折叠侧边栏的制作
- 在html中解析xml文件(javascript 读取)
- 属性字符串NSMutableAttributedString使用例子 -- iOS开发
- rac模式下如何处理spfile文件参数故障(没有备份pfile)
- [Java]String、StringBuilder与StringBuffer
- android客户端从服务器端获取json数据并解析的实现代码
- 缓存架构设计细节二三事
- xxx
- 滴滴2017Java开发笔试题
- Redis数据“丢失”问题
- BGRABitmap图像操作11:定制Scanner,渐变生成