开发者

Dismissing Modal View Controller causing layout problems

开发者 https://www.devze.com 2023-02-27 10:47 出处:网络
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

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消