Created
November 18, 2015 17:14
-
-
Save markthethomas/793b824cb3b8d931fe35 to your computer and use it in GitHub Desktop.
react native part 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const React = require('react-native'); | |
const { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
Image, | |
View, | |
} = React; | |
const myProjectName = React.createClass({ | |
render: function() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}> | |
Fall has come at last! | |
</Text> | |
<View style={{flex: 1}}> | |
<Image style={styles.image} source={require('./assets/fall.jpg')}/> | |
</View> | |
</View> | |
); | |
} | |
}); | |
const styles = StyleSheet.create({ | |
image: { | |
width: 400, | |
height: 500 | |
}, | |
container: { | |
flex: 1, | |
paddingTop: 20, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF', | |
}, | |
welcome: { | |
fontSize: 20, | |
textAlign: 'center', | |
margin: 10, | |
}, | |
instructions: { | |
textAlign: 'center', | |
color: '#333333', | |
marginBottom: 5, | |
}, | |
}); | |
AppRegistry.registerComponent('myProjectName', () => myProjectName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment