Can you try setting clip to bounds
[_photoview setClipsToBounds:YES];
Or directly in your Storyboard / Xib if you can :
If you want to expand your knowledge there is a really good article on how the iOS UIView stack is rendered. There is also a more in-depth article about the whole drawing pipeline.
In summary:
Rasterisation - All the view's content is rasterised (drawn or a offscreen pixel buffer) in coordinate space of the View's bounds. This could be image data or custom drawing (i.e. drawRect:
) but subview content. This rasterisation takes into account the contentMode
property.
Anything outside of a view’s bounds is discarded.
Composition - The results are composited (drawn on top of each other) from subview to superviews. This uses the frame property of the subview.
If the clipsToBounds
property is YES
on the superview then it will discard subview content outside of its bounds.
had the same problem and it was resolved by ticking "Clip Subviews".
The image was showing up properly for all views (3.5,4,4.7,5.5,ipad) in storyboard preview but not in the simulator.
After I ticked "Clip Subviews" the problem was resolved. :)
Checking "Clip subviews" directly in the Storyboard/Xib also worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With