enter image description hereI am using react native vision camera in my react native cli app, I am able to successfully scan the code but there is a problem with the alignment.
Basically, when clicked on a scan button, a modal is opened up with the qr code in the center. The problem is the qr code sometimes goes to the top left corner.
I tried margin: ‘auto’, flex, and positioning property. But after 5 successful run the camera again goes to the top left corner
const device = useCameraDevice('back');
if (device == null) {
return (
<View>
<Text className="text-black">Device not fount</Text>
</View>
);
}
{showCamera && (
<Pressable
onPress={() => setShowCamera(false)}
style={[
{backgroundColor: 'rgba(0, 0, 0, 0.9)'},
]}
className=" absolute top-0 right-0 left-0 bottom-0">
<View style={styles.Container}>
<Camera
style={styles.camera}
device={device}
isActive={true}
codeScanner={codeScanner}
/>
{/* Buttons */}
<View className="my-5">
// close and refresh button
</View>
</View>
</Pressable>
)}
enter image description here