mirror of
https://github.com/status-im/react-native-camera.git
synced 2025-02-24 01:38:18 +00:00
Update RNCamera.md
This commit is contained in:
parent
160e1e5277
commit
cd3fcf5c31
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user