Skip to content

Instantly share code, notes, and snippets.

@brol1dev
Created January 8, 2016 00:32
Show Gist options
  • Save brol1dev/4328eca33b3bed2408dd to your computer and use it in GitHub Desktop.
Save brol1dev/4328eca33b3bed2408dd to your computer and use it in GitHub Desktop.
React Android Switch
/**
* 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