本文共 1645 字,大约阅读时间需要 5 分钟。
在react-native项目中包含了android和ios的完整的项目结构,可以通过android studio和xcode进行打开和运行,所以可以通过webstorm直接打开react-native的整个项目,然后通过android studio进行打开android项目,用android studio编译运行,在webstorm进行开发。
import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; export default class hello_world extends Component { render() { return (); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, }); AppRegistry.registerComponent('hello_world', () => hello_world); Welcome to React Native! To get started, edit index.android.js Double tap R on your keyboard to reload,{'\n'} Shake or press menu button for dev menu
转载地址:http://voajn.baihongyu.com/