UiLabel的属性和用法
2013-01-07 14:57
134 查看
/************************************************************************************************
UILabel * scoreLabel=[[UILabel alloc]initWithFrame:CGRectMake(50.0, 50.0, 150.0, 43.0)]
[scoreLabel setBackgroundColor:[UIColor clearColor]]; //设置背景颜色为透明,之外你还可以使用自定义的颜色:
[scoreLabel setText:@"好好学习,天天向上"]; //设置显示文字
[scoreLabel setTextColor:[UIColor blackColor]];//设置显示文字的颜色,可以设置多种颜色
[scoreLabel setTextAlignment:NSTextAlignmentCenter];//设置文字对齐位置居中 /**********************************************************************************
[scoreLabel setTextAlignment:NSTextAlignmentLeft];//设置文字对齐位置居左
[scoreLabel setTextAlignment:NSTextAlignmentRight];//设置文字对齐位置右
***********************************************************************************/
[scoreLabel setFont:[UIFont fontWithName:@"accbound" size:(25.0)]];//设置字体的类型,为粗体 调用系统的字体配置。 [scoreLabel setAdjustsFontSizeToFitWidth:YES];//设置字体的大小是否适应lable的宽度。
[scoreLabel setShadowColor:[UIColor redColor]]; //设置阴影颜色.
[scoreLabel setShadowOffset:CGSizeMake(1.0, 1.0)];//设置阴影偏移位置.
[scoreLabel setUserInteractionEnabled:YES]; //设置进行交互
[scoreLabel setHighlighted:YES];//设置文本是否高亮
[scoreLabel setHighlightedTextColor:[UIColor blueColor]]; //设置文本高亮时的颜色
[scoreLabel setHidden:NO];//设置一开始是否将label进行隐藏
[scoreLabel setNumberOfLines:1]; //设置lable的行数,这个也可以选择一个适应的高度
[self.view addSubview:scoreLabel];
*********************************************************************************/
UILabel * scoreLabel=[[UILabel alloc]initWithFrame:CGRectMake(50.0, 50.0, 150.0, 43.0)]
[scoreLabel setBackgroundColor:[UIColor clearColor]]; //设置背景颜色为透明,之外你还可以使用自定义的颜色:
[scoreLabel setText:@"好好学习,天天向上"]; //设置显示文字
[scoreLabel setTextColor:[UIColor blackColor]];//设置显示文字的颜色,可以设置多种颜色
[scoreLabel setTextAlignment:NSTextAlignmentCenter];//设置文字对齐位置居中 /**********************************************************************************
[scoreLabel setTextAlignment:NSTextAlignmentLeft];//设置文字对齐位置居左
[scoreLabel setTextAlignment:NSTextAlignmentRight];//设置文字对齐位置右
***********************************************************************************/
[scoreLabel setFont:[UIFont fontWithName:@"accbound" size:(25.0)]];//设置字体的类型,为粗体 调用系统的字体配置。 [scoreLabel setAdjustsFontSizeToFitWidth:YES];//设置字体的大小是否适应lable的宽度。
[scoreLabel setShadowColor:[UIColor redColor]]; //设置阴影颜色.
[scoreLabel setShadowOffset:CGSizeMake(1.0, 1.0)];//设置阴影偏移位置.
[scoreLabel setUserInteractionEnabled:YES]; //设置进行交互
[scoreLabel setHighlighted:YES];//设置文本是否高亮
[scoreLabel setHighlightedTextColor:[UIColor blueColor]]; //设置文本高亮时的颜色
[scoreLabel setHidden:NO];//设置一开始是否将label进行隐藏
[scoreLabel setNumberOfLines:1]; //设置lable的行数,这个也可以选择一个适应的高度
[self.view addSubview:scoreLabel];
*********************************************************************************/
相关文章推荐
- UILabel 的属性(用法)方法
- IOS控件学习:UILabel常用属性与用法
- IOS控件学习:UILabel常用属性与用法
- IOS控件学习:UILabel常用属性与用法
- iphone开发:UILabel的一些属性和常见用法
- 给iOS开发新手送点福利,简述UILabel的属性和用法
- IOS控件学习:UILabel常用属性与用法
- 简述UILabel的属性和用法
- UILabel与UIFont的用法和属性的一些总结
- IOS之UILabel的常见属性及用法
- UILabel 属性的基本用法
- IOS控件学习:UILabel常用属性与用法
- IOS控件学习:UILabel常用属性与用法
- UILabel的一些常用用法汇总
- shape基本用法及全部属性定义
- JSP中request属性的用法 (转)
- Activity中ConfigChanges属性的用法
- UILabel上的文字 单独改变 属性
- 对象属性中的指针用法
- html meta标签属性用法集合