You can programmatically control the GestureViewer
using the useGestureViewerController
hook.
id?: string
GestureViewer
instance."default"
Property | Description | Type | Default Parameter |
---|---|---|---|
goToIndex | Navigate to a specific index. | (index: number) => void | - |
goToPrevious | Navigate to the previous item. | () => void | - |
goToNext | Navigate to the next item. | () => void | - |
zoomIn | Zoom in by the specified multiplier. | (multiplier?: number) => void | 0.25 |
zoomOut | Zoom out by the specified multiplier. | (multiplier?: number) => void | 0.25 |
resetZoom | Reset zoom to the specified scale. | (scale?: number) => void | 1 |
rotate | Rotate by the specified angle. | (angle?: RotationAngle, clockwise?: boolean) => void | 90, true |
zoomIn(multiplier?)
0.01 ~ 1
)zoomIn(0.5)
→ Zoom in by an additional 50% of the current scalezoomOut(multiplier?)
0.01 ~ 1
)zoomOut(0.3)
→ Zoom out by dividing the current scale by 1.3resetZoom(scale?)
resetZoom(1.5)
→ Reset to 1.5x scalerotate(angle?, clockwise?)
0
, 90
, 180
, 270
, 360
)rotate(90)
→ Rotate 90 degrees clockwiserotate(90, false)
→ Rotate 90 degrees counter-clockwiserotate(0)
→ Reset rotation