[Android] Should add a props to fix the issue on failing to change camera size
See original GitHub issueLike many other issues mentioned, the size of camera is unable to be changed in some SDK version (not sure which versions are them, it worked fine on 26 but broken on 28 in my case).
After I added a ratio manually like below I can resize the camera into square again
<Camera
ratio={"1:1"} //add this line manually to avoid the camera being resized into 4:3 by default
style={[styles.camera, this.props.cameraStyle]}
onBarCodeRead={this._handleBarCodeRead.bind(this)}
type={this.props.cameraType}
>
So perhaps it would be helpful to have a [props.cameraRatio] in the future to deal with the resizing of camera. Just like:
<Camera
ratio={this.props.cameraRatio}
style={[styles.camera, this.props.cameraStyle]}
onBarCodeRead={this._handleBarCodeRead.bind(this)}
type={this.props.cameraType}
>
P.S I really appreciate you guys made this package, our team use it in our project(called tico), it’s really helpful and easy to be implemented. Good job and thank you 😃
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:8 (1 by maintainers)
Top Results From Across the Web
[Tweaks][Guide]Build.prop Tweaks | XDA Forums
The thing is that if you are having any rooted Android device. So this tweak will work absolutely fine. Every user can do...
Read more >Configuration options | Android Developers
Although CameraX creates and manages the session, you should always check the returned image sizes on the use case output in your code...
Read more >RNCamera · React Native Camera
For Android, this prop attempts to control the camera sensor capture resolution, similar to how ratio behaves.
Read more >Using React Native Camera in your app - FullStack Labs
And we need to set up permissions for both Android and iOS. ... In the case of iOS we just need to edit...
Read more >React Native - How to make image width 100 percent and ...
So, my question is what is the best way to deal with this situation? Do I have to manually put width, height size...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/moaazsidat/react-native-qrcode-scanner/issues/182
cameraStyle={{overflow: 'hidden'}}
- it helped me@howieyoung I faced the same issue and fixed just adding
cameraProps={{ratio: "1:1"}}