UiLabel的属性和用法

/************************************************************************************************
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];
*********************************************************************************/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值