UIView.ClipsToBounds Property


Specifies whether the Subviews are confined to the Bounds of the receiver.

[get: Foundation.Export("clipsToBounds")]
[set: Foundation.Export("setClipsToBounds:")]
public virtual bool ClipsToBounds { get; set; }
member this.ClipsToBounds : bool with get, set

Property Value

The default value is false.



If this property is false, subviews whose Frame extends beyond their Superview's Bounds will be fully displayed. If this property is true, only that portion that lies within their Superview's Bounds will be displayed.

In the following image, the green rectangles are subviews of the blue rectangles (var innerView = new UIView(new RectangleF(-10, 10, 175, 25));). The top blue rectangle has its ClipsToBounds left at the default false value while the lower rectangle shows the clipping that occurs when ClipsToBounds is set to true.

Applies to