Created
January 8, 2016 00:32
-
-
Save brol1dev/4328eca33b3bed2408dd to your computer and use it in GitHub Desktop.
React Android Switch
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
*/ | |
'use strict'; | |
var React = require('react-native'); | |
var { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
Switch, | |
} = React; | |
var SamplesAndroid = React.createClass({ | |
render: function() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}> | |
Welcome to React Native! | |
</Text> | |
<Switch style={styles.switchy} | |
disabled={false} | |
value={true} /> | |
</View> | |
); | |
} | |
}); | |
var styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF', | |
}, | |
welcome: { | |
fontSize: 20, | |
textAlign: 'center', | |
margin: 10, | |
}, | |
switchy: { | |
width: 100 | |
}, | |
}); | |
AppRegistry.registerComponent('SamplesAndroid', () => SamplesAndroid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment