PinchOptions
Sets a pinch() gesture's callbacks, and when and where it takes touches.
Verwendung
Apply a pinch's change in scale.
Dieser Typ wird verwendet von pinch
// Apply a pinch's change in scale.
import { Text, pinch, signal, type PinchChangeEvent } from 'kuito';
const fontSize = signal(17);
// Text size follows the pinch, between 12 and 34 points.
const resize = (event: PinchChangeEvent) => {
fontSize.value = Math.min(34, Math.max(12, fontSize.value * event.scaleChange));
};
<Text fontSize={fontSize.value} gestures={[pinch({ onChange: resize })]}>
Pinch to resize
</Text>;Typdeklaration
export type PinchOptions = Common & Callbacks<PinchEvent, PinchChangeEvent>;Mitglieder 5
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
disabled | boolean | Nein | Ignores touches, like a disabled Pressable. |
hitArea | HitArea | Nein | Insets of the area that takes touches: one for every edge, or by edge. |
onStart | (event: PinchEvent) => void | Nein | It activated. |
onChange | (event: PinchChangeEvent) => void | Nein | It moved, with the change since the last move. |
onEnd | (event: PinchEvent, success: boolean) => void | Nein | It ended after activating: success is false when it was cancelled. |
onStart — Methodensignaturen
Signaturen
onChange — Methodensignaturen
Signaturen
(event: PinchChangeEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | PinchChangeEvent | Ja | — |
Rückgabe
void
onEnd — Methodensignaturen
Signaturen
(event: PinchEvent, success: boolean): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | PinchEvent | Ja | — |
success | boolean | Ja | — |
Rückgabe
void
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.