react-native-barcode-scanner-google
react-native-barcode-scanner-google copied to clipboard
camera view, fullscreen not working
Hi! I'am following the example on the readme section, and camera doesnt seem to get fullscreen on physical device, even with style flex: 1.
Here is the code:
import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Alert } from 'react-native'; import BarcodeScanner from 'react-native-barcode-scanner-google';
export default class BarcodeApp extends Component { render() { return ( <View style={{ flex: 1 }}> <BarcodeScanner style={{ flex: 1, }} onBarcodeRead={({data, type}) => { // handle your scanned barcodes here! // as an example, we show an alert: Alert.alert(
Barcode '${data}' of type '${type}' was scanned.
); }} /> </View> ); } }AppRegistry.registerComponent('brcodegooglern', () => BarcodeApp);
What could this be related to?
Thanks for the great lib, @ekreutz.
I have this issue in my emulator too. I'm running a virtual device in my AVD: 720x1280. API 22. Android 5.1. x86
.
This is what I see using cameraFillMode={CameraFillMode.COVER}
And this is what it looks like with cameraFillMode={CameraFillMode.FIT}
I pass dimensions of the window to the style props like this:
const { width, height } = Dimensions.get('window');
return (
<BarcodeScanner
style={{ width, height }}
onException={this.handleException}
onBarCodeRead={this.handleBarcodeRead}
cameraFillMode={CameraFillMode.COVER}
barcodeType={BarcodeType.EAN_13}
/>
)
i've the same problem, any solution?
Hello guys, the camera view fits in mobiles but its not fully fit in some tablet. any solution?