加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ReactNative Demo - NavigationView 使用

发布时间:2020-12-15 03:27:11 所属栏目:百科 来源:网络整理
导读: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 :
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,textAlign: 'left'}}>Hello</Text> <Text style={{margin: 10,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);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读