
react-native
reylen
企业平台app开发
展开
-
react-navigation之navigate
react-navigation之navigatenavigate用于页面之间的跳转,eg : navigation.navigate("routeName", {postText:"ddd"});参数1 跳转页面参数2 传递的参数 paramsreact-navigation官方推荐 params要尽可能的简单化,简单的key、value。避免添加callback函数或者数据对象,但是避免不了页面返回的时候需要回调的问题,这时候官方推荐了坚决方案。还是通过 navigate,eg:原创 2021-09-24 17:09:54 · 4378 阅读 · 0 评论 -
iOS Podfile修改优化
post_install do |installer| installer.pods_project.targets.each do |target| if (target.name&.eql?('FBReactNativeSpec')) target.build_phases.each do |build_phase| if (build_phase.respond_to?(:name) && build_phase.n...原创 2021-08-11 14:02:51 · 903 阅读 · 0 评论 -
error: Cycle in dependencies between targets ‘FBReactNativeSpec‘
error: Cycle in dependencies between targets ‘FBReactNativeSpec’处理方法Click on the Pods project on the left sidebarGo under Build PhasesMake sure [CP-User] Generate Specs is before Headershttps://github.com/facebook/react-native/issues/31034...原创 2021-08-10 14:31:21 · 1925 阅读 · 0 评论 -
Undefined symbols for architecture arm64: “Swift._ArrayBuffer._copyContents...“
运行环境 macOSnode v14 run-android$ react-native run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 1358 file(s) to forward-jetify. Using 4 workers...info JS server already run原创 2021-06-25 17:07:47 · 366 阅读 · 0 评论 -
react-native EventEmitter 移除了once()方法记录
EventEmitter: Delete once() and removeCurrentListener() …Summary:In an effort to simplify and clean up the EventEmitter abstractions in React Native, this removes once() and removeCurrentListener(). Across the Facebook codebase, there were only two calle原创 2021-06-23 15:30:36 · 497 阅读 · 0 评论 -
react-native webview同h5、vue页面交互记录
h5 或者vue添加监听 /* * vue 监听采用 * window.window.addEventListener ios * window.document.addEventListener android * h5 * window.addEventListener ios * document.addEventListener android * */// 具体是用window还是document如上面描述win...原创 2021-05-25 15:13:40 · 641 阅读 · 1 评论 -
'config.h' file not found 问题处理方法
react-native 项目在编译的时候,突然报错 ‘config.h’ file not found mutex.h处理方法很简单,以此执行以下命令:cd node_modules/react-native/third-party/glog-0.3.4../../scripts/ios-configure-glog.sh...原创 2018-12-04 10:08:50 · 5120 阅读 · 0 评论 -
XCode升级10版本遇到的link问题
Xcode升级到最新版本10,有些旧的项目运行出报错,如 link error,具体如下:error:Build input file cannot be found:‘/Users/…/Libraries/WebSocket/libfishhook.a’这是我的一个react-native 项目在进行XCode上进行编译的时候所报的错误,libfishhook 链接错误,找不到文件了,解决的...原创 2018-10-23 10:48:42 · 1450 阅读 · 0 评论 -
react-native之Realm数据库的使用(一)
realm数据库是一款小型数据库系统,可以支持多个平台,如android、ios、javascript等。当然了realm也是可以支持react-native的,官网有具体介绍,官网文档安装realmnpm install --save realm然后linkreact-native link realm或者rnpm link realm如果link不完全,可以手动检查添加1.Add the fol原创 2017-11-09 16:19:41 · 3781 阅读 · 0 评论 -
react-native 下编写工具、Public类
在react-native开发中,一些常用到的方法函数,我们可以提取出来写到一个公共的类里面,方便不同页面的调用。 首先、新建一个文件 PublicUtils.js 里面实现如下:let PublicUtils = { GUID: ()=> { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, f原创 2017-08-19 09:00:38 · 625 阅读 · 0 评论 -
react-native之Image加载url图片问题
react-native之Image加载图片问题Image加载图片有两种方式,一种是本地资源,一种可以是网络图片,本地资源加载,如:<Image source={require('./images/add.png')}/>这种方式简单,都没有问题。通过url的方式加载图片,如: <Image source={{uri:'http://xxxxxxxx'}} style={{width: 90,原创 2017-07-06 10:29:37 · 18448 阅读 · 1 评论 -
react-native 之 ref 的使用
在react-native中可以通过 ref属性来获取组件,并设置组件的属性及其方法,实例如下class TestRef extends Component { // 构造 constructor(props) { super(props); // 初始状态 this.state = {}; this.changeSty原创 2017-06-29 16:50:00 · 5412 阅读 · 0 评论 -
react-native之flex布局总结
flex布局之横纵布局 <View style={{flex: 1, flexDirection: 'row'}}> <View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} /> <View style={{width: 50, height: 50, backgroundC原创 2017-04-22 10:21:57 · 696 阅读 · 0 评论