I am using react-native-draggable for the drag and drop of an image in an android application. The drag and drop work perfectly but the image size is getting cropped out.
For the vertical images some part of the top and bottom is getting cropped and for horizontal photos left and right side of the image getting cropped out. I have tried changing the render size and position but it's still getting cropped.
I really appreciate it if anyone can help on this issue.
Sharing the following snippet for the drag and drop
<Draggable
imageSource={route.params.url}
renderSize={230}
x={130}
y={90} />
I have figured out a way for this issue, instead of giving the image as a source in the draggable component, I have created an Image widget with the image URI and placed that Image widget inside the draggable which eventually solve the crop issue. Following is the source code.
<Draggable
maxX={MOBILE_WIDTH}
maxY={MOBILE_HEIGHT}
minX={0}
minY={0}
x={FRAME_XPOSITION}
y={FRAME_YPOSITION}>
<Image
source={route.params.url}
size="2xl"
alt="Image"
resizeMode="contain"
resizeMethod="scale"
/>
</Draggable>