UILable的属性介绍
来源:互联网 发布:网络传销诈骗标语 编辑:程序博客网 时间:2024/06/07 15:09
- (void)viewDidLoad{ [super viewDidLoad]; /* Accessing the Text Attributes text property font property textColor property textAlignment property lineBreakMode property enabled property Sizing the Label’s Text adjustsFontSizeToFitWidth property baselineAdjustment property minimumFontSize property 无例 numberOfLines property Managing Highlight Values highlightedTextColor property highlighted property Drawing a Shadow shadowColor property shadowOffset property userInteractionEnabled property */ UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(50.0, 20.0, 200.0, 50.0)]; UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(50.0, 80.0, 200.0, 50.0)]; UILabel *label3 = [[UILabel alloc]initWithFrame:CGRectMake(50.0, 140.0, 200.0, 50.0)]; UILabel *label4 = [[UILabel alloc]initWithFrame:CGRectMake(50.0, 200.0, 200.0, 50.0)]; //设置显示文字 label1.text = @"label111111111111111"; label2.text = @"label2"; label3.text = @"label3--label3--label3--label3--label3--label3--label3--label3--label3--label3--label3--"; label4.text = @"label4--label4--label4--label4--"; //设置字体大小 label1.font = [UIFont systemFontOfSize:20.0]; label2.font = [UIFont boldSystemFontOfSize:20.0];//粗体 //文字颜色 label1.textColor = [UIColor redColor]; //文字对齐方式 //label1.textAlignment = UITextAlignmentCenter; //iOS6.0中已弃用 //linebreakmode 文字打断模式(过长) 默认位NSLineBreakByWordWrapping label2.lineBreakMode = NSLineBreakByClipping; //enabled 是否可用(是否响应事件和文字是否修改) label2.enabled = YES; //Sizing the Lable's text label2.adjustsFontSizeToFitWidth = YES; // label1.baselineAdjustment = UIBaselineAdjustmentAlignCenters; //miniumFontSize //iOS6.0中已弃用 //label1.minimumFontSize = 14; //设置lable的行数 label4.numberOfLines = 3; //Managing Highlight values //设置高亮 label1.highlighted = YES; label1.highlightedTextColor = [UIColor orangeColor]; //设置阴影 label3.shadowColor = [UIColor redColor]; label3.shadowOffset = CGSizeMake(2.0, 2.0); //设置交互 label3.userInteractionEnabled = YES; [self.view addSubview:label1]; [self.view addSubview:label2]; [self.view addSubview:label3];
0 0
- UILable的属性介绍
- UILable 的 属性设置
- UILable的lineBreakMode属性
- 如何设置UILable的各种属性
- UILable 属性详解
- UIlable 属性设置 全
- UILable文本属性设置
- UILable UILabel的各种属性与方法的使用
- UILable常用属性和方法
- UILable,UIFont,UIButton常见属性
- UILable常用属性和方法
- iOS UILable常用属性总结
- UILable常用的方法
- UIlable UITextField的用法
- UILable的常用用法
- UILable的attributedText使用
- UILable标签的设置
- UILable的lineBreakMode
- serialVersionUID的作用
- hdu3715 二分+2sat+建图
- tomcat直接输入Ip和端口号就可以主动加载一个jsp页面!
- Valid Palindrome
- getopt和getopt_long函数
- UILable的属性介绍
- AMBA、AHB、APB、ASB总线简介
- linux重定向简介
- ScrollView下的ListView问题解决
- android 中向手机端安装apk 的时候报出 INSTALL_FAILED_INSUFFICIENT_STORAGE 错误的解决方法
- 浮点数陷阱
- 【36】在O(1)的时间删除链表结点
- Winphone开发之数据绑定(3)
- 判断二叉树是否是平衡二叉树