即使在实现 shouldAutorotateToInterfaceOrientation 后视图也不会调整大小
对于我的代码, shouldAutorotateToInterfaceOrientation 被调用,我在那里返回 YES,但是当我旋转设备时,控制器的视图会更改其大小,但主视图内的 UIImageView 不会更改其大小。我希望它像主视图一样调整大小。
提前致谢
for my code,
shouldAutorotateToInterfaceOrientation is getting called and i am returning YES there but still when I rotate the device, controller's view change its size but a UIImageView inside the main view does not change its size. I want it to be resized just like the main view.
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置 autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth 根据您的需要。
在代码中
如果您已在 xib 中创建,则在 IB 中设置

如下图所示
set the
autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth
according to your need.In code
If you have created in xib then in IB set

this as shown in the below image