ReactNative Demo - NavigationView 使用

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  Image,
  DrawerLayoutAndroid,
  ListView,
} from 'react-native';



class AwesomeProject extends Component {

  
  render() {
    

  var navigationView = (
    <View style={{flex: 1, backgroundColor: '#fff',flexDirection:"column",}}>
      <Text style={{margin: 10, fontSize: 15, textAlign: 'left'}}>I'm in the Drawer!</Text>
    </View>
  );
  return (
    <DrawerLayoutAndroid
      drawerWidth={300}
      drawerPosition={DrawerLayoutAndroid.positions.Right}
      renderNavigationView={() => navigationView}>
      <View style={{flex: 1, alignItems: 'flex-end',justifyContent: "space-around"}}>
        <Text style={{margin: 10, fontSize: 15, textAlign: 'left'}}>Hello</Text>
        <Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>World!</Text>
      </View>
    </DrawerLayoutAndroid>
  );


  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
   elements:{
    alignItems: "flex-start",
    color:"#000000",
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
  base: {
    width: 38,
    height: 38,
  },
  background: {
    backgroundColor: '#ff0000',
  },
  active: {
    borderWidth: 2,
    borderColor: '#00ffff',
  },
});

AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);

转载请注明出处:http://www.jianshu.com/u/c864df301e25

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
禁止转载,如需转载请通过简信或评论联系作者。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,536评论 25 708
  • 前些日子从@张鑫旭微博处得一份推荐(Front-end-tutorial),号称最全的资源教程-前端涉及的所有知识...
    谷子多阅读 4,285评论 0 44
  • 刚给枫哥哥打完电话,起先不知道说什么,电话通起来居然就告诉枫哥哥可可生了2只公1只母的,没有遗传妈妈泰迪的品...
    我是我的天涯阅读 147评论 0 3
  • 岁云天冻, 昭明台处日长灯疏, 水涯一片茫茫。 汀田隐雾, 独舟归休,难述阔怀。 寒色高林下作梁甫吟声, 问君太子...
    摩羯星一号阅读 403评论 2 5