1 react-native init myProject

2.修改App.js

 

import React, { Component } from 'react';
import { Text, View } from 'react-native';

export default class HelloWorldApp extends Component {
  render() {
    return (
        <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
          <Text>Hello, Keny88888!</Text>
        </View>
    );
  }
}

代码定义了一个名为HelloWorldApp的新的组件(Component)。你在编写 React Native 应用时,肯定会写出很多新的组件。而一个 App 的最终界面,其实也就是各式各样的组件的组合。组件本身结构可以非常简单——唯一必须的就是在render方法中返回一些用于渲染结构的 JSX 语句

 

3.react-native run-android

react native 弱爆例子

 

 

相关文章:

  • 2021-07-09
  • 2021-11-21
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2021-06-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2021-10-16
相关资源
相似解决方案