Instance Property

capInsets

The end-cap insets.

Declaration

@property(nonatomic, readonly) UIEdgeInsets capInsets;

Discussion

End caps specify the portion of an image that should not be resized when an image is stretched. This technique is used to implement buttons and other resizable image-based interface elements. When a button with end caps is resized, the resizing occurs only in the middle of the button, in the region between the end caps. The end caps themselves keep their original size and appearance.

This property specifies the sizes of all four end caps. The middle (stretchable) portion consists of all the pixels that are not included in the end caps. These pixels are tiled, left-to-right, top-to-bottom to fill the remaining space.

On a non-resizable image, this property is set to UIEdgeInsetsZero; the image does not use end caps and the entire image is subject to stretching. To create a new image with a nonzero value for this property, use the resizableImageWithCapInsets: method. If your application specifies UIEdgeInsetsZero as the capInsets parameter, the entire image is tiled.

See Also

Image Attributes

imageOrientation

The orientation of the receiver’s image.

UIImageOrientation

A value describing the intended display orientation for an image.

flipsForRightToLeftLayoutDirection

A Boolean value that indicates whether the image should flip in a right-to-left layout.

resizingMode

The resizing mode of the image.

UIImageResizingMode

Specifies the possible resizing modes for an image.

duration

Returns the time interval used to display an animated image.

alignmentRectInsets

The alignment metadata used to position the image during layout.

symbolImage

A Boolean value indicating whether the image is vector-based.