![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react native
允潇的博客
废物
展开
-
react native中flatlist的scrollToIndex等方法使用
1.设置ref<FlatList ref={this._getRef} data={data} refreshing={this.state.refreshing} onRefresh={this._freshData} getItemLayout={(param, index) => ({ length: 64, offset: 64 * index, index...原创 2018-05-18 14:56:10 · 12272 阅读 · 0 评论 -
react native 0.52.0适配iPhone X遇到上下黑边的问题。
一开始以为是要加safeAreaView,后来发现使用0.50.0的版本初始化的项目,没有使用safeAreaView也可以全屏。后来发现只要在XCODE中配置iPhone X的启动图即可,不用使用safeAreaView便签。前提是XCODE支持iPhone X的sdk。启动图要求为2436*1125的分辨率。...原创 2018-05-18 15:57:02 · 907 阅读 · 0 评论 -
react native 0.52.0 真机远程调测JS方法
当初开发APP使用的是0.52.0这个版本后台需要真机远程调测JS,根据官方文档:https://facebook.github.io/react-native/docs/0.52/running-on-device.html无需配置,只需要在同wifi下,将debug版本的通过XCODE安装在手机中,摇动手机弹出开发选项,选择“remote js DEbugging”即可,但实际中手机一直显示谷...原创 2018-06-04 15:50:28 · 997 阅读 · 1 评论 -
react-navigation中TabNavigator切换时重新渲染
在使用 react-navigation时(版本如下)react-navigation": "1.5.11",假设2个tab页,A与B登陆之后默认呈现A页面,通过触摸底部B切换B页面。A与B页面只在第一次进入时执行react生命周期函数,请求数据并渲染,二次切换页面时并不会触发。如果有二次查询的需求时,可按照如下方法进行。假设需要每次点击B页面都需要查询数据并渲染。1.在B页面中添加如下代码com...原创 2018-06-12 18:23:03 · 7534 阅读 · 0 评论 -
react native中的CameraRoll使用时,TypeError: Cannot read property 'getPhotos' of undefined错误
CameraRoll是RN的静态类,使用getPhotos方法时,如果xcode没有配置依赖包,则会报错。报错TypeError: Cannot read property 'getPhotos' of undefined错误。问题解决如下:1.在xcode中手动导入RCTCameraRoll.xcodeproj右键“Library”,选择“Add ....” RCTCameraRoll.xc...原创 2018-06-27 00:10:34 · 1445 阅读 · 0 评论 -
首次运行react native 报错 unable to find utility "instruments", not a developer tool or in PATH
解决方法:在 终端执行如下命令sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/注意:前提是你已经安装了xcode原创 2019-05-14 10:41:31 · 389 阅读 · 0 评论 -
首次运行react native项目,build很慢,提示“double-conversion”、“third-party”等关键字
xcode版本:10.1macOS: 10.13.6react native版本:0.59.8$ cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../$ cd node_modules/react-native/third-party/glog...原创 2019-05-14 10:46:36 · 3637 阅读 · 0 评论