transformOrigin prop changes this pivot point using 0–1 fractions of the view’s dimensions.
The transformOrigin Prop
x: Horizontal origin.0= left edge,0.5= center,1= right edge. Default:0.5y: Vertical origin.0= top edge,0.5= center,1= bottom edge. Default:0.5
Common Values
| Value | Position |
|---|---|
{ x: 0, y: 0 } | Top-left |
{ x: 0.5, y: 0.5 } | Center (default) |
{ x: 1, y: 1 } | Bottom-right |
{ x: 0.5, y: 0 } | Top-center |
{ x: 0, y: 0.5 } | Left-center |
Examples
Rotate from top-left corner
Useful for fold-out panels, accordion arrows, and hinged elements.Scale from bottom-right
Platform Implementation
- iOS
- Android
Sets
anchorPoint on the view’s CALayer. Because changing anchorPoint shifts the layer’s visual position, the updateLayoutMetrics:oldLayoutMetrics: override compensates by adjusting the layer’s position to keep the view visually in place.