上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 29 下一页
摘要: 在现有的iOS工程中集成react native, 或者说将react native引入到iOS 项目,是RN和iOS混合开发的必经之路 参考官网教程:https://reactnative.cn/docs/integration-with-existing-apps/ 但是会有一些步骤报错,这里记 阅读全文
posted @ 2019-10-18 16:13 liuw_flexi 阅读(1139) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.jianshu.com/p/02c630ed7725 tabBar1页面有按钮,点击切换到tabBar2 直接用this.props.navigation.navigate('tabBar2'); //这里tabBar1,tabBar2都在createBottomTab 阅读全文
posted @ 2019-10-12 14:05 liuw_flexi 阅读(239) 评论(0) 推荐(0) 编辑
摘要: https://github.com/crazycodeboy/react-native-easy-toast 用法: 在render()方法的return()中的最末尾: 在需要吐司的地方: 阅读全文
posted @ 2019-10-11 13:26 liuw_flexi 阅读(895) 评论(0) 推荐(0) 编辑
摘要: https://github.com/crazycodeboy/react-native-event-bus 用法: A页面和B页面中都有相同的列表,点击B页面中的收藏按钮,A页面会跟着更新 阅读全文
posted @ 2019-10-11 13:21 liuw_flexi 阅读(1372) 评论(0) 推荐(0) 编辑
摘要: 使用Context,可以跨越组件进行数据传递 通过静态方法React.createContext()创建一个Context对象,这个Context对象包含两个组件,<Provider />和<Consumer />。 <Provider />的value相当于现在的getChildContext() 阅读全文
posted @ 2019-10-11 10:40 liuw_flexi 阅读(2789) 评论(0) 推荐(0) 编辑
摘要: redux是什么?他是一个state容器,这个容器中存放所有页面的state。 redux的运作方式是怎样的? actions: 可以理解为用户和手机间的交互行为,比如点了一个按钮,下拉刷新,上拉加载更多。。。都可以写成一个action, 一个页面可能会有很多个action。一般action.js中 阅读全文
posted @ 2019-09-23 14:02 liuw_flexi 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 请求数据=>本地有无缓存+缓存数据是否过期 =>可用 =>不可用 将代码封装成一个DataStore.js文件, 这里面主要提供:从本地获取数据,从网络获取数据,创建本地时间戳,请求数据入口 import {AsyncStorage} from 'react-native'; export defa 阅读全文
posted @ 2019-09-23 13:44 liuw_flexi 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 新建AsncStorageDemoPage.js import React, {Component} from 'react'; import { StyleSheet, View, Text, Button, TextInput, AsyncStorage, } from 'react-nativ 阅读全文
posted @ 2019-09-23 13:36 liuw_flexi 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 这是一个单独的页面,可以从其他地方跳转过来。 输入语言关键字,从github检索相关数据 import React, {Component} from 'react'; import { StyleSheet, View, Text, Button, TextInput, } from 'react 阅读全文
posted @ 2019-09-23 13:26 liuw_flexi 阅读(779) 评论(0) 推荐(0) 编辑
摘要: 1. 首先是使用react navigation跳转页面时传值,A->B 利用 params = { name : 'XXX', age: 28, number : '18812345678' } 2. react navigation如何goBack到指定页面? https://www.cnblo 阅读全文
posted @ 2019-09-19 18:07 liuw_flexi 阅读(757) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 29 下一页