Default Camera to flex of 1

This commit is contained in:
aarongrider 2021-02-04 15:55:47 -08:00
parent 66f517599c
commit 75edaf08c6
4 changed files with 2 additions and 4 deletions

View File

@ -121,7 +121,6 @@ import { Camera, CameraType } from 'react-native-camera-kit';
```tsx
<Camera
ref={(ref) => (this.camera = ref)}
style={{ flex: 1 }}
cameraType={CameraType.Back} // front/back(default)
/>
```

View File

@ -10,7 +10,6 @@ export default class CameraExample extends Component {
<Camera
ref={this.camera}
cameraType={CameraType.Back} // optional
style={{ flex: 1 }}
flashMode="auto" // on/off/auto(default)
focusMode="on" // off/on(default)
zoomMode="on" // off/on(default)

View File

@ -25,7 +25,7 @@ function Camera(props, ref) {
_.update(transformedProps, 'laserColor', (c) => processColor(c));
_.update(transformedProps, 'surfaceColor', (c) => processColor(c));
return <NativeCamera flashMode={props.flashMode} ref={nativeRef} {...transformedProps} />;
return <NativeCamera style={{flex: 1}} flashMode={props.flashMode} ref={nativeRef} {...transformedProps} />;
}
const { PORTRAIT, PORTRAIT_UPSIDE_DOWN, LANDSCAPE_LEFT, LANDSCAPE_RIGHT } = RNCameraKitModule.getConstants();

View File

@ -23,7 +23,7 @@ function Camera(props, ref) {
const transformedProps = _.cloneDeep(props);
_.update(transformedProps, 'cameraOptions.ratioOverlayColor', (c) => processColor(c));
return <NativeCamera ref={nativeRef} {...transformedProps} />;
return <NativeCamera style={{flex: 1}} ref={nativeRef} {...transformedProps} />;
}
Camera.defaultProps = {