如何在UIView上居中放置UILabel [英] How to center a UILabel on UIView
本文介绍了如何在UIView上居中放置UILabel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在UIView上居中放置UILabel?我正在使用以下代码
How can I center the UILabel on the UIView? I am using the following code
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];
这篇关于如何在UIView上居中放置UILabel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文