TheHellOTrofasdasd
TheHellOTrofasdasd

Reputation: 153

Make UIView go out of bounds but still be visiable

I need a UIView to go out of the superviews bounds but still be visiable. If I move it out of bounds it is cut out.

Upvotes: 0

Views: 389

Answers (1)

John Wickham
John Wickham

Reputation: 647

It's likely that the superview has clipsToBounds set to true. Here's what Apple's documentation says about the property:

A Boolean value that determines whether subviews are confined to the bounds of the view.

Discussion Setting this value to YES causes subviews to be clipped to the bounds of the receiver. If set to NO, subviews whose frames extend beyond the visible bounds of the receiver are not clipped. The default value is NO.

To have subviews outside the bounds visible, try myView.clipsToBounds = false

Upvotes: 1

Related Questions