GestureView

Diese Komponente bietet Unterstützung für gängige Touch-Gesten – Tippen, doppeltes Tippen, langes Drücken, Schwenken und Kneifen. Sie verarbeitet auch gängige mausbasierte Gesten, einschließlich Doppelklicks und Scrollrad-Eingaben.

Informationen über ausstehende Gesten werden über Ereignisbehandler zurückgegeben. Ein Aufrufer kann angeben, an welchen Gesten er interessiert ist, indem er diese Ereignisbehandler angibt. Wenn Sie beispielsweise an doppelten Tippern und horizontalen Schwenks interessiert sind, stellen Sie einen onDoubleTap- und einen onPanHorizontal-Behandler bereit.

Props

// Alternate text for screen readers.
accessibilityLabel: string = undefined;

// Traits used to hint screen readers, etc.
accessibilityTraits: AccessibilityTrait | AccessibilityTrait[] = undefined;

// Expose the element and/or its children as accessible to Screen readers
importantForAccessibility?: ImportantForAccessibility =
    ImportantForAccessibility.Yes;

// Gestures and attributes that apply only to touch inputs
onPinchZoom: (gestureState: MultiTouchGestureState) => void = undefined;
onRotate: (gestureState: MultiTouchGestureState) => void = undefined;

// Gestures and attributes that apply only to mouse inputs
onScrollWheel: (gestureState: ScrollWheelGestureState) => void = undefined;
mouseOverCursor: GestureMouseCursor = undefined;

// Gestures and attributes that apply to either touch or mouse inputs
onPan: (gestureState: PanGestureState) => void = undefined;
onPanVertical: (gestureState: PanGestureState) => void = undefined;
onPanHorizontal: (gestureState: PanGestureState) => void = undefined;
onTap: (gestureState: TapGestureState) => void = undefined;
onDoubleTap: (gestureState: TapGestureState) => void = undefined;
onContextMenu: (gestureState: TapGestureState) => void = undefined;
onLongPress: (gestureState: TapGestureState) => void = undefined;

// Focus Events
onFocus: (e: FocusEvent) => void = undefined;
onBlur: (e: FocusEvent) => void = undefined;

// Keyboard Events
onKeyPress: (e: KeyboardEvent) => void = undefined;

// We can set vertical or horizontal as preferred
preferredPan: PreferredPanGesture = undefined; // Horizontal or vertical

// How many pixels (in either horizontal or vertical direction) until
// pan is recognized? Default is 10. Can be any value > 0.
panPixelThreshold: number = undefined;

// Something else wants to become responder. Should this view
// release the responder? Setting true allows release.
releaseOnRequest: boolean = false;

// ID that can be used to identify the instantiated element for testing purposes.
testId: string = undefined;

Stile

Flexbox-Stile

Ansichtsstile

Transformationsstile

Methoden

// Sets the accessibility focus to the component.
focus(): void;