2

I am designing an iOS App where there is a View controller with an embedded view controller in view at the bottom, and an image at the top. However, I'm having problems with the Image view. Without image view, everything is OK. When I put the image view, the image view doesn't fit in the image correctly. Here is how it looks in the interface builder (set to Scale to Fill):

enter image description here

When I run it in my iPod Touch (iOS 6), This is how it looks:

enter image description here

The image's aspect ratio is different than shown in the Interface Builder. Then, I try setting the image mode to Aspect Fill (which is actually the one I want):

enter image description here

This is exactly what I actually want, but when I run it, the image fills almost the entire screen:

enter image description here

Notice how my friend picker view controller is left behind the image view. The layout of the entire view controller is correct (embedded view controller is located correctly, notice at the point where the image ends in the last screenshot, it starts from J, meaning that it continues to the top behind the image), it's only the image view that is occupying too much space. I've tried different arrangements of the frame rectangle, and tried toggling Auto-layout of iOS 6. Neither did help. Am I missing an obvious point, or is it a bug with the layout system of iOS. (probably the second one, as WYSIWYG fails between Interface Builder and actual app) Are there any workarounds (other than cropping the portion of the image in Photoshop at the exact size that I want)?

Thanks,

Can.

UPDATE: A workaround that I've currently found is to put the image view in another view, and set the parent view's clip subviews property ticked. But the image view itself is still not behaving correctly, and even though this currently solved my problem, it is not a real solution, so any solution answers are welcome.

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389

0 Answers0