我正在尝试预览在下一个场景中获得的图像,但是当我单击相机按钮时不会发生过渡。
import { Actions } from 'react-native-router-flux';
import Camera from 'react-native-camera';
export default class PageTwo extends Component {
render() {
return (
<View style={styles.container} >
<Camera ref={(cam) => { this.camera = cam; }}
style={styles.preview}
aspect={Camera.constants.Aspect.fill}>
<Text style={styles.capture}
onPress={this.takePicture.bind(this)}>
<Icon name="ios-camera"/>
</Text>
</Camera>
</View>
)
}
takePicture() {
this.camera.capture()
.then((data) => {Actions.previewimg});
}
}