Good day! Question on Objective-c. There are two UIVIews. The first is on the controller itself, and the second is on the first UIView. If I change the coordinates of the second to negative, then it starts to draw outside the parent (first). How to get rid of it? PS: Used for parallax effect when scrolling text. The background leaves behind the edge, and begins to draw over the bar status.

    1 answer 1

    I understand that you want the parent to cut off the child view and prevent it from being drawn beyond its limits. If so, you need to put parentView.clipsToBounds = YES;