UIImageView 旋转后不居中
我手动将 UIImageView 添加到我的 UIView 并将其居中,这工作正常,但旋转设备后,UIImageView 不再居中(它移至左下角)。我该如何解决这个问题?
logoView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wi-fi-sticker.png"]];
logoView.center = self.view.center;
[self.view addSubview:logoView];
问候, 萨沙
I manually add an UIImageView to my UIView and center it, this works fine, but after rotating the device, the UIImageView isn't centered anymore (it's moved to the lower left). How can I fix this?
logoView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wi-fi-sticker.png"]];
logoView.center = self.view.center;
[self.view addSubview:logoView];
Regards,
Sascha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每次使用这样的东西我都能正确居中
I was able to center mine correctly every time using something like this