设置 label 的行间距和删除线
来源:互联网 发布:unity3d入门到精通pdf 编辑:程序博客网 时间:2024/04/29 10:21
/** Label 设置文字行间距 */
NSMutableParagraphStyle * style = [[NSMutableParagraphStyle alloc]init];
[style setLineSpacing:10];
label.attributedText = [[NSAttributedString alloc]initWithString:@"北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司" attributes:@{NSFontAttributeName:
[UIFont systemFontOfSize:11.f],
NSForegroundColorAttributeName:[UIColor whiteColor], NSParagraphStyleAttributeName:style}];
[self.view addSubview:label];
NSAttributedString *attrStr =
[[NSAttributedString alloc]initWithString:@"100.0"
attributes:
@{NSFontAttributeName:[UIFont systemFontOfSize:20.f],
NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#5bcec0"],
NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid),
NSStrikethroughColorAttributeName:[UIColor colorWithHexString:@"#5bcec0"]}];
label1.attributedText = attrStr;
[self.view addSubview:label1];
NSMutableParagraphStyle * style = [[NSMutableParagraphStyle alloc]init];
[style setLineSpacing:10];
label.attributedText = [[NSAttributedString alloc]initWithString:@"北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司北京新鲜智造科技有限公司" attributes:@{NSFontAttributeName:
[UIFont systemFontOfSize:11.f],
NSForegroundColorAttributeName:[UIColor whiteColor], NSParagraphStyleAttributeName:style}];
[self.view addSubview:label];
NSAttributedString *attrStr =
[[NSAttributedString alloc]initWithString:@"100.0"
attributes:
@{NSFontAttributeName:[UIFont systemFontOfSize:20.f],
NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#5bcec0"],
NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid),
NSStrikethroughColorAttributeName:[UIColor colorWithHexString:@"#5bcec0"]}];
label1.attributedText = attrStr;
[self.view addSubview:label1];
0 0
- 设置 label 的行间距和删除线
- 设置Label的行间距
- 设置label的行间距
- 设置Label的行间距
- 设置label 的 字间距 和行间距
- label设置行间距
- Label设置行间距
- Label设置行间距
- Label 设置行间距 和 title格式
- 设置多行label的行间距
- iOS设置label行间距的方法
- 设置label.text的行间距
- iOS 设置Label的行间距
- XZ_iOS之设置label的行间距
- label的行间距
- Label中设置行间距
- iOS Label行间距设置
- iOS设置Label行间距
- poi导出excel直接打包的方法
- 基于Activiti5工作流实战企业协同OA办公系统(spring-data-jpa、uur前台组件)
- oj--C++结构体之统计最高最低分
- Android中TextView中设置字体颜色
- 商品秒杀
- 设置 label 的行间距和删除线
- 科目二难点——倒车入库
- 让你的javascript支持AMD,CMD和原生JS
- PS教程!手把手教你打造复古几何无缝纹理背景
- Silver Cow Party poj 3268 Dijkstra,spfa,+vector
- JAVA反射机制(及反射调用的性能简测)
- HDU 1402 A * B (FFT)
- 设备驱动--中断开关执行的匹配
- Android 高仿 频道管理----网易、今日头条、腾讯视频 (可以拖动的GridView)附源码DEMO