I have a white screen instead of the camera when I use Navigator.
This is my code :
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
Image,
TouchableHighlight,
TouchableOpacity,
Navigator,
} = React;
var Camera = require('react-native-camera'); //require the camera component
var PageCamera = React.createClass({
render: function() {
return (
<Navigator
renderScene={this.renderScene.bind(this)}
navigator={this.props.navigator}/>
);
},
renderScene(route, navigator) {
return (
<View style={styles.container}>
<Camera style={styles.camera} ref="cam" type={Camera.constants.Type.back} captureTarget={Camera.constants.CaptureTarget.memory}></Camera>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF'
},
camera: {
position: 'absolute',
top: 20, right: 20, bottom: 20, left: 20
},
captured: {
width: 200,
height: 400
},
captureButton: {
position: 'absolute',
height: 50,
left: 50, bottom: 20, right: 50,
backgroundColor: '#FFFFFF',
borderRadius: 20,
},
switchButton: {
position: 'absolute',
height: 50,
left: 50, top: 20, right: 50,
backgroundColor: '#FFFFFF',
borderRadius: 20,
},
});
module.exports = PageCamera;
I try the same without Navigator, as your example, and it works.