PinchOptions
Sets a pinch() gesture's callbacks, and when and where it takes touches.
Utilisation
Apply a pinch's change in scale.
Ce type est utilisé par 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>;Déclaration du type
export type PinchOptions = Common & Callbacks<PinchEvent, PinchChangeEvent>;Membres 5
| Nom | Type | Requis | Description |
|---|---|---|---|
disabled | boolean | Non | Ignores touches, like a disabled Pressable. |
hitArea | HitArea | Non | Insets of the area that takes touches: one for every edge, or by edge. |
onStart | (event: PinchEvent) => void | Non | It activated. |
onChange | (event: PinchChangeEvent) => void | Non | It moved, with the change since the last move. |
onEnd | (event: PinchEvent, success: boolean) => void | Non | It ended after activating: success is false when it was cancelled. |
onStart — signatures de méthode
Signatures
onChange — signatures de méthode
Signatures
(event: PinchChangeEvent): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | PinchChangeEvent | Oui | — |
Retourne
void
onEnd — signatures de méthode
Signatures
(event: PinchEvent, success: boolean): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
event | PinchEvent | Oui | — |
success | boolean | Oui | — |
Retourne
void
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.