gpt4 book ai didi

ios - 如何使 UILabel 在 UIView 上居中

转载 作者:IT王子 更新时间:2023-10-29 07:41:08 25 4
gpt4 key购买 nike

如何让 UILabel 在 UIView 上居中?我正在使用以下代码

float width = weatherView.bounds.size.width; 
float height = weatherView.bounds.size.height;

[self.label setFrame:CGRectMake(width-100,height-100, 100, 100)];

最佳答案

怎么样:

[self.label setCenter:view.center];

关于ios - 如何使 UILabel 在 UIView 上居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6753794/

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