Closed hungtooc closed 1 year ago
I'm trying to prevent user move the image by one finger, allow user move by two (using zoom event). Here í my code:
const onshiftingbefore = () => { return true; };
<ReactNativeZoomableView maxZoom={30} minZoom={0.9} panBoundaryPadding={300} // movementSensibility={1} ref={zoomableViewRef} // contentWidth={300} // contentHeight={200} bindToBorders={true} onShiftingEnd={onShiftEnd} onShiftingAfter={onshiftingafter} onShiftingBefore={onshiftingbefore} onTouchStart={ontouchStart} onTouchMove={_onTouchMove} onTouchCancel={_onTouchCancel} onLongPress={_onLongPress} // onTransform = {_onTransform} onTouchEnd={ontouchEnd} > <Image ref={image} style={{ width: "100%", height: "100%", resizeMode: "contain" }} source={{ uri: "https://picsum.photos/200/300" }} /> </ReactNativeZoomableView>
the result is: https://user-images.githubusercontent.com/24487114/197664219-52f8ffa4-e3f9-4c4a-83f1-4996a8bd5aa2.mp4
I'm trying to prevent user move the image by one finger, allow user move by two (using zoom event). Here í my code:
the result is: https://user-images.githubusercontent.com/24487114/197664219-52f8ffa4-e3f9-4c4a-83f1-4996a8bd5aa2.mp4