-
-
Save classpro/8bd9a40edc1ee8472328 to your computer and use it in GitHub Desktop.
Revisions
-
TiagoGouvea created this gist
Oct 10, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ /** * Sample React Native App * https://github.com/facebook/react-native */ 'use strict'; var React = require('react-native'); var { AppRegistry, StyleSheet, Text, View, DrawerLayoutAndroid, TouchableHighlight, } = React; var DrawerTest = React.createClass({ openDrawer:function() { this.refs['DRAWER'].openDrawer() }, render: function() { var navigationView = ( <View style={{flex: 1, backgroundColor: '#fff'}}> <Text style={{margin: 10, fontSize: 15, textAlign: 'left'}}>I'm in the Drawer!</Text> </View> ); return ( <DrawerLayoutAndroid drawerWidth={300} ref={'DRAWER'} drawerPosition={DrawerLayoutAndroid.positions.Left} renderNavigationView={() => navigationView}> <View style={{flex: 1, alignItems: 'center'}}> <Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>Hello</Text> <Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>World!</Text> <TouchableHighlight onPress={this.openDrawer}> <Text>{'Open Drawer'}</Text> </TouchableHighlight> </View> </DrawerLayoutAndroid> ); } }); AppRegistry.registerComponent('DrawerTest', () => DrawerTest);