首页
IT
登录
6mi
u
盘
搜
搜 索
IT
iOS —label自动换行
iOS —label自动换行
xiaoxiao
2021-04-12
30
UILabel
*label = [[UILabel
alloc
]initWithFrame:frame];
label
.text
= tileName;
//背景颜色为红色
label
.backgroundColor
= [UIColor
redColor
];
//设置字体颜色为白色
label
.textColor
= [UIColor
whiteColor
];
//文字居中显示
label
.textAlignment
= UITextAlignmentCenter;
//自动折行设置
label
.lineBreakMode
= UILineBreakModeWordWrap;
label
.numberOfLines
=
0
;
[
self
.collectionView
addSubview
:label];
转载请注明原文地址: https://ju.6miu.com/read-667461.html
技术
最新回复
(
0
)