更改 iPad 方向时 Web 视图的布局问题
当我将 iPad 应用程序切换为横向模式时遇到问题。当我这样做时,网络视图的格式全部搞砸了。
这是处于纵向模式时的情况。有一个滚动视图,它是视图控制器的子视图,在滚动视图中,有三个 Web 视图,您可以通过左右滑动在它们之间滚动。
这是进入横向模式时发生的情况:
关于这是为什么的任何想法? Interface Builder 中的所有设置(帧边距设置、自动调整子视图大小等)都是正确的,但我似乎无法弄清楚为什么它会这样做。
提前致谢!
I'm having trouble when I flip my iPad app around to landscape mode. When I do this, the formatting of the web views gets all screwed up.
This is when it is in portrait mode. There is a scroll view which is the subview of the view controller, and within the scroll view there are three web views which you can scroll between by swiping left and right.
This is what happens when it goes into Landscape mode:
Any ideas as to why this is? All the settings in Interface Builder (the frame margin settings, autoresize subviews, etc.) are all correct, but I can't seem to figure out why it does what it does.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在之前的项目中也遇到过同样的问题。我通过在 didRotateFromInterfaceOrientation 回调期间重新加载内容解决了该问题。还有更好的解决方案吗?
I have experienced the same problem in my previous project. I solved the problem by reloading the content during the didRotateFromInterfaceOrientation callback. Any better solutions?