I have a UIView that contain another subview. The subview's frame is outside of the bounds of the super view. But the entire subview is visible in when I run the application. Example:
++++++++++++++++++++++++++++ + + + Super view + + + + + + -------------------------- + - Subview + - + - + - + -------------------------- + + + + ++++++++++++++++++++++++++++
Should be:
++++++++++++++++++++++++++++ + + + Super view + + + + + + ---------------------+ + - Subview + + - + + ---------------------+ + + + + ++++++++++++++++++++++++++++
Any idea?
If you're setting up your views in code, set the clipsToBounds
property of the superview to YES
.
If you're setting up your views in a nib, turn on the “Clip Subviews” checkbox on the superview. It's off by default, as in this screenshot:
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