ideacreation / react-native-barcodescanner

A barcode scanner component for react native - not maintained anymore - use react-native-camera
MIT License
537 stars 162 forks source link

pop to the Previous scene in android 4.x black scene in screen #47

Closed Cocoon-break closed 7 years ago

Cocoon-break commented 7 years ago

use component in the scene,and I pop it .some thing happened. a

ncnlinh commented 7 years ago

I just had the same issue.

ncnlinh commented 7 years ago

Apparently it only happens if I use InteractionManager to render a placeholder (to finish the navigation animation) before the actual scanner is rendered

liuyimx commented 7 years ago

@Cocoon-break 我也遇到此问题,现在你是如何解决的?

liuyimx commented 7 years ago

@ncnlinh it's not work for me, i remove all 'InteractionManager' use.

h2oiswater commented 7 years ago

黑屏啊 黑屏啊 太烦了

h2oiswater commented 7 years ago

@Cocoon-break 解决了吗?

michalkow commented 7 years ago

I have the same problem. I do not use InteractionManager.

monotv commented 7 years ago

Same behaviour here when using InteractionManager to render a placeholder for the scanner.

"react-native": "^0.30.0" "react-native-barcodescanner": "^3.1.1"

h2oiswater commented 7 years ago

When I changed the camera view not full screen, this bug never show again.

This is not perfect but useful method.

someok commented 7 years ago

use marginHorizontal: 1 fix the black screen problem.

<BarcodeScanner
                        ref={view => this.scanner = view}
                        onBarCodeRead={this._onBarCodeRead}
                        style={styles.scanner}
                    />
scanner: {
        flex: 1,

        // 上下留个边, 否则在小米下返回的时候会出现底部黑边
        marginHorizontal: 1,
    }
michalkow commented 7 years ago

@someok Your solution works for me. I have no idea how you figured that out, but kudos to you sir!

knapeto commented 7 years ago

OMG it works!! Thanks..

Cocoon-break commented 7 years ago
<View style={{flex:1}}>
    <BarcodeScanner
        onBarCodeRead={this._onBarCodeRead}
        style={{flex:1}}
        torchMode={'off'}
        cameraType={'back'}/>
</View> 

fixed width wrap a view and style={{ flex: 1}}