How to shorten the contents of a UIView?

Please, help!!! I use a gesture recognizer to move my UIView. During the move, I change the width of my view, but the content becomes out of bounds ... How to reduce the content of the view? I only need to temporarily shorten it, not delete, because I need to restore the contents. Does anyone know a solution?

+3
source share
2 answers

Set the clipsToBounds property of your view to YES (either programmatically or in the interface builder).

+6
source

subviews , iOS clipsToBounds, .

myView.clipsToBounds = YES;
+2

All Articles