自动缩放 UIView 和旋转的所有内容
这应该很简单,但现在我却无法理解。
我有一个处于纵向模式的应用程序,当将设备倾斜到横向模式时,我只想将所有内容按比例缩小,以便所有内容都显示在屏幕中央,这会导致左侧出现空白区域,右侧(这很好)。如何在 Interface Builder 中进行设置?我有一个包含 UIView 的视图,希望通过正确调整该视图的大小,所有 UIImageView 等也应该按比例缩小。
This should be simple but it just eludes me now.
I have an app in portrait mode, and when tilting the device into landscape mode, I just want all of the content to aspect scale down so that all content is displayed in the center of the screen, which would cause empty space on the left and right sides (this is fine). How do I set this up in Interface Builder? I have one containing UIView and am hoping that by having that one properly resized, all of the UIImageViews etc should also be aspect scaled down.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是 Rincewind 在 Apple 论坛上的答案……它对我有用。我必须为顶视图的所有子视图正确处理 contentMode 和自动缩放参数,当方向改变时,我调整了子视图的大小(更改了其框架)。
So this is the answer from Rincewind over at Apple's forums... it worked out for me. I had to work on the contentMode and autoscaling parameters properly for all subviews of the top view, which I resized (changed its frame) when orientation changes.