Search code examples
ios6container-view

iOS change container view height dynamically


How can one change the height of the container view dynamically depending on the amount of images of its childView?

container


Solution

  • It's a view like any other view, so you change it in the same way. You'll need to arrange to get a reference to it. When you set things up in the storyboard like this, you get an extra level of hierarchy that you wouldn't get if you created the parent-child view-controller architecture by hand (in code): there is a container view and inside that is the child view controller's view, whereas if you do it in code, there is no container view - the child view controller's view is all there is.