I am using React native camera <RNCamera></RNCamera> in my react native project for QR scan . I am facing this problem that I cannot resize the height of the camera viewport.
I tried using flexing down the column into 3 each of 2 and then placed it in the middle, it expands itself to take a certain height size.
Also I tried setting the height in the style but it still expands to a definite size.
Heres what I did.
<View style={{ flex: 2, }}></View>
<View style={{ marginHorizontal: 16,flex:2 }}>
<RNCamera
ref={(ref) => {
this.camera = ref;
}}
style={{ height: newWidth }}
captureAudio={false}
type={RNCamera.Constants.Type.back}
flashMode={RNCamera.Constants.FlashMode.on}
androidCameraPermissionOptions={{
title: 'Permission to use camera',
message: 'We need your permission to use your camera',
buttonPositive: 'Ok',
buttonNegative: 'Cancel',
}}
onBarCodeRead={(barcodeText) => { this._onBarcodeRead(barcodeText); }}
>
<View style={{ flex: 2.5 }}>
</View>
</RNCamera>
</View>
<View style={{ flex: 2, }}></View>
Each of the flexes if styled with a backgroundcolor attribute, it can be seen that the flexes are working properly. But the scope of RNCamera always expands beyond the set boundaries.
Can someone guide me on how to style the RNCamera Viewport , or is it a fixed height view that cannot be changed?