Update RNCamera.md

This commit is contained in:
Paras Sharma 2018-02-06 02:24:18 +05:30 committed by GitHub
parent 160e1e5277
commit cd3fcf5c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ import {
Dimensions,
StyleSheet,
Text,
TouchableHighlight,
TouchableOpacity,
View
} from 'react-native';
import { RNCamera } from 'react-native-camera';
@ -26,19 +26,20 @@ class BadInstagramCloneApp extends Component {
ref={ref => {
this.camera = ref;
}}
style={{
flex: 1,
}}
type={RNCamera.Constants.Type.back}
style = {styles.preview}
type={RNCamera.Constants.Type.front}
flashMode={RNCamera.Constants.FlashMode.on}
permissionDialogTitle={'Permission to use camera'}
permissionDialogMessage={'We need your permission to use your camera phone'}
/>
<View style={{flex: 0, flexDirection: 'row', justifyContent: 'center',}}>
<TouchableOpacity
onPress={this.takePicture.bind(this)}
>
<Text> SNAP </Text>
</TouchableOpacity>
style = {styles.capture}
>
<Text style={{fontSize: 14}}> SNAP </Text>
</TouchableOpacity>
</View>
</View>
);
}
@ -56,7 +57,22 @@ class BadInstagramCloneApp extends Component {
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
flexDirection: 'column',
backgroundColor: 'black'
},
preview: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center'
},
capture: {
flex: 0,
backgroundColor: '#fff',
borderRadius: 5,
padding: 15,
paddingHorizontal: 20,
alignSelf: 'center',
margin: 20
}
});
@ -345,4 +361,4 @@ Become a sponsor and get your logo on our README on Github with a link to your s
------------
Thanks to Brent Vatne (@brentvatne) for the `react-native-video` module which provided me with a great example of how to set up this module.
Thanks to Brent Vatne (@brentvatne) for the `react-native-video` module which provided me with a great example of how to set up this module.