博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
react-native 项目实战 -- 新闻客户端(1) -- 初始化项目结构
阅读量:7221 次
发布时间:2019-06-29

本文共 1016 字,大约阅读时间需要 3 分钟。

1.在项目根目录新建Componet文件夹(专门用来放我们的自定义组件),里面新建Main.js、Home.js、Message.js、Mine.js、Find.js 

 

2.修改 index.android.js

/** * android */import React, { Component } from 'react';import {  AppRegistry,} from 'react-native';// 引用外部组件var Main = require('./Component/Main');class NewsDemo extends Component {  render() {    return (      
); }}AppRegistry.registerComponent('NewsDemo', () => NewsDemo);

 

3.Main.js

/** * 主页面 */import React, { Component } from 'react';import {    AppRegistry,    StyleSheet,    Text,    View} from 'react-native';var Main = React.createClass({    render() {        return (            
主页面
); }});const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, },});// 输出类module.exports = Main;

 

4.效果图

.

 

转载地址:http://skhym.baihongyu.com/

你可能感兴趣的文章
安装VirtualBox虚拟机,并将Oracle安装在虚拟机中
查看>>
ufw--使用说明
查看>>
PostgreSQL新手入门
查看>>
经典的python代码
查看>>
vmware10 虚拟机克隆 centos7 完整步骤
查看>>
linux命令行安装VmwareTools(CentOS)
查看>>
Linux常用命令收集整理
查看>>
Sublime Text 2 使用心得
查看>>
我的友情链接
查看>>
Property文件读取的Util类
查看>>
WEBService
查看>>
samba服务器的搭建
查看>>
IO端口和IO内存
查看>>
zookeeper安装
查看>>
第五周作业
查看>>
linux ssh使用深度解析(key登录详解)
查看>>
S3cmd 中国区客户端配置详解
查看>>
不错的Qt, QtCreator学习网址
查看>>
phpMyAmin相关问题解决汇总
查看>>
求最大子序列和
查看>>