Picture grows vertically and covers label


#1

xxx


#2

Using iOS 5 or 6?

Using autolayout?


#3

I was seeing a similar effect with ios6 until I made the UIImageView object smaller. Had to leave a 1" gap on the XIB view between the UIImageView and the top of the UIToolbar Then the scaling worked as expected, and the ios simulator appears without space. Something must be off in the scaling between Xcode and the simulator.


#4

UINavigationController resizes DetailViewController’s view to fit under the navigation bar. Whatever you design in Interface Builder needs to have the springs and struts (or autolayout) set such that it will gracefully scale down to a shorter height.


#5

If you’re using autolayout, I find that adding “bottom/top space to superview” to the UIImageView so that there’s a defined space below the image such that there’s space for the UIToolBar or the top where the labels are. If it’s not defined already, add a vertical space for the UIImageView to define how far from the top or bottom, depending on which you haven’t done yet, the image should be. Finally break the constraints for the height of the UIImageView. This defines the area that the picture will fit by telling it that you need p distance from the bottom and q distance from the top, but you don’t care how high the image will be.

In stoney’s example. I think the height constraint was set and maybe a vertical distance to the bottom, therefore when the program tried to place the image it started from the bottom and filled the image’s height to the specified amount which ended up overlapping the labels in order to fit.