gpt4 book ai didi

ios - UILabel 顶部对齐多行

转载 作者:可可西里 更新时间:2023-11-01 05:35:58 25 4
gpt4 key购买 nike

我在 UICollectionView 中有一个包含 4 行的 UILabel。当少于 4 行时,我希望文本位于顶部而不是中心。

谢谢..

最佳答案

这是解决方案

dispatch_async(dispatch_get_main_queue(), ^{
yourLabel.numberOfLines = 0;
[yourLabel sizeToFit];


});

关于ios - UILabel 顶部对齐多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19519740/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com