Instance Property


The frame rectangle, which describes the view’s location and size in its superview’s coordinate system.


@property(nonatomic) CGRect frame;


This rectangle defines the size and position of the view in its superview’s coordinate system. Use this rectangle during layout operations to set the size and position the view. Setting this property changes the point specified by the center property and changes the size in the bounds rectangle accordingly. The coordinates of the frame rectangle are always specified in points.

Changing the frame rectangle automatically redisplays the view without calling its drawRect: method. If you want UIKit to call the drawRect: method when the frame rectangle changes, set the contentMode property to UIViewContentModeRedraw.

Changes to this property can be animated. However, if the transform property contains a non-identity transform, the value of the frame property is undefined and should not be modified. In that case, reposition the view using the center property and adjust the size using the bounds property instead.

See Also

Configuring the Bounds and Frame Rectangles


The bounds rectangle, which describes the view’s location and size in its own coordinate system.


The center point of the view's frame rectangle.


Specifies the transform applied to the view, relative to the center of its bounds.