UIView.ClipsToBounds Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public virtual bool ClipsToBounds { [Foundation.Export("clipsToBounds")] get; [Foundation.Export("setClipsToBounds:")] set; }
member this.ClipsToBounds : bool with get, set
Property Value
The default value is false
.
- Attributes
Remarks
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
.