UILable缩进、行间距设置、边框
来源:互联网 发布:战舰世界驱逐舰数据 编辑:程序博客网 时间:2024/06/06 03:49
NSString*textStr =@“”;
//设置边框 颜色、先款、圆角
self.detailLab.layer.borderColor= [UIColoryellowColor].CGColor;
self.detailLab.layer.borderWidth= 2;
self.detailLab.layer.cornerRadius= 6;
self.detailLab.layer.cornerRadius= 6;
self.detailLab.layer.masksToBounds= YES;
self.detailLab.text= textStr;
//设置Lable的行间距setLineSpacing、段间距setHeadIndent、首行缩进setFirstLineHeadIndent NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStylealloc]init];
[paragraphStyle1 setLineSpacing:10.0];
[paragraphStyle1 setFirstLineHeadIndent:10];
[paragraphStyle1 setHeadIndent:5];
NSMutableAttributedString * attributedString1 = [[NSMutableAttributedStringalloc]initWithString:self.detailLab.textattributes:@{NSParagraphStyleAttributeName:paragraphStyle1}];
[paragraphStyle1 setFirstLineHeadIndent:10];
[paragraphStyle1 setHeadIndent:5];
NSMutableAttributedString * attributedString1 = [[NSMutableAttributedStringalloc]initWithString:self.detailLab.textattributes:@{NSParagraphStyleAttributeName:paragraphStyle1}];
self.detailLab.attributedText= attributedString1;
//设置行间距后适配高度显示
[_detailLabsizeToFit];
0 0
- UILable缩进、行间距设置、边框
- UIlable 设置行间距
- UIWebView、UITextView 和UILable 设置行间距
- uilable换行显示,设置行间距
- 成长记-UILable设置行间距
- Xamarin.iOS UILable行间距设置
- UILable 行间距
- CSS设置字间距、行间距、首行缩进
- Android 设置文字text 行间距、行高、缩进
- UILable显示不同的字体颜色、字体大小、行间距、首行缩进、下划线等属性(NSMutableAttributedString)
- 设置UILable中的行间距和字间距以及自适应高度,段落首行挤进
- css行间距字间距首字缩进
- iOS之label行间距的缩进
- 关于UILable自适应问题--《内容多少》《行间距》
- 设置NSTextField行间距
- 设置ComboBox行间距
- label设置行间距
- UILabel 设置行间距
- Wikioi 1138 聪明的质检员
- Python初级学习笔记
- Hibernate总结(转载)
- Java中的static与final关键字的作用
- [MFC]如何让窗口全屏
- UILable缩进、行间距设置、边框
- test
- 自定义带有删除功能的edittext实例,在登录,搜索等地方经常用到可以直接用
- 详细记录python的range()函数用法
- Mybatis一个对象关联两个对象(多对一)
- leetcode_234. Palindrome Linked List 判断单链表是否为回文串,快慢指针法找中间节点,反转单链表
- iOS切图拉伸
- [dp][NOIP2005]过河
- Anroid TextureView、SurfaceView的Camera预览实现