我有一个在CGRect中显示的图像。如何使矩形在视图中居中?
下面是我的代码:
UIImage * image = [UIImage imageNamed:place.image];
CGRect rect = CGRectMake(10.0f, 90.0f, image.size.width, image.size.height);
UIImageView * imageView = [[UIImageView alloc] initWithFrame:rect];
[imageView setImage:image];
我已经尝试过imageView.center,但是没有效果。
提前谢谢。
https://stackoverflow.com/questions/3678255
复制相似问题