ios之Label的创办
ios之Label的创建
UILabel
*label = [[
UILabel
alloc
]initWithFrame:CGRectMake(
1
0
,
1
0
0
,
3
0
0
,
1
5
0
)];
label
.text
=
@"Hello
world!"
;
//背景颜色为红色
label
.backgroundColor
= [
UIColor
redColor
];
//设置字体颜色为白色
label
.textColor
= [
UIColor
whiteColor
];
//文字居中显示
label
.textAlignment
=
UITextAlignmentCenter
;
//自动折行设置
label
.lineBreakMode
=
UILineBreakModeWordWrap
;
label
.numberOfLines
=
0
;
//设置字体
label
.font
=
[
UIFont
fontWithName
:
@"Arial-BoldItalicMT"
size
:32
];
//设置阴影的颜色
label.shadowColor
= [UIColor blackColor]