contentsGravity
A constant that specifies how the layer’s contents are positioned or scaled within its bounds.
Discussion
The possible values for this property are listed in Contents Gravity Values.
The default value of this property is resize.
Figure 1 shows four examples of the effect of setting different values for a layer’s contentsGravity property.
[Image]
Contents gravity is resize - the default
Contents gravity is center
Contents gravity is contentsAreFlipped() ? top : bottom
Contents gravity is contentsAreFlipped() ? bottomLeft : topLeft
See Also
Modifying the layer’s appearance