解决模态视图控制器导致布局问题 [英] Dismissing Modal View Controller causing layout problems

查看:162
本文介绍了解决模态视图控制器导致布局问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在导航控制器中有一个UIScrollVIew,我从导航控制器中提供了一个模态视图控制器,它可以正常工作。当我关闭模态视图控制器(来自父级)时,我的UIScroll视图中的所有内容都会被移动并且分页被破坏。滚动视图的内容是以编程方式添加的,但scrollView是在IB中创建的。

I have a UIScrollVIew in a Navigation controller, I present a Modal View controller from the Navigation controller, which works fine. When I dismiss the modal view controller (from the parent), all the content in my UIScroll view gets moved around and paging is broken. The contents of the scroll view are added programmatically, but the scrollView was created in IB.

推荐答案

听起来与它有关自动调整行为以及自动调整大小的掩码。在IB中,关闭与ScrollView相关的自动调整子视图。

Sounds like it has to do with autoresizing behavior as well as the autoresizing masks. In IB, turn off "Autoresize Subviews" in relation to the ScrollView.

还要检查它的自动调整模板:它有意义吗?玩它的面具和麻烦从那里拍摄。以编程方式创建视图时,默认的自动调整大小屏蔽可能具有意外行为。

Also check its autoresizing mask: does it make sense? Play with its mask and trouble shoot from there. When you create views programmatically, the default autoresize mask may have unexpected behavior.

这篇关于解决模态视图控制器导致布局问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆