
React Native
Sky_Cat
这个作者很懒,什么都没留下…
展开
-
React Native 预览PDF文件
安装依赖。原创 2023-02-11 12:28:45 · 847 阅读 · 0 评论 -
React Native WebView加载本地HTML
加载本地HTML文件,需要对Webview的allowFileAccess设置访问本地文件为true然后设置source的uri属性:file:///data/data/com.wangjie/files/wangjie/dist/index.html原创 2020-08-12 11:39:20 · 546 阅读 · 0 评论 -
React Native设置Image自适应
添加Image的resizeMode="contain"属性原创 2020-08-11 09:15:53 · 1902 阅读 · 0 评论 -
react +antd创建web项目
react 创建项目1:安装CNPMnpm install -g cnpm --registry=https://registry.npm.taobao.org2:查看CNPM版本cnpm -v3:create-react-app 项目名称4:yarn add react-router-dom5:yarn add antd原创 2020-05-21 10:50:17 · 377 阅读 · 0 评论 -
React Native真机调试
Step1:运行CMD命令行Step2:CD到项目目录Step3:查看已连接的设备信息:adb devicesStep4:设置反向代理端口 adb reverse tcp:8081 tcp:8081Step5:运行项目,react-native run-android (注意,如果有多个路径先清除一下缓存:react-native start --reset-cache...原创 2020-04-28 10:09:55 · 341 阅读 · 0 评论 -
Path must be a string. TypeError: Path must be a string.
yarn run v1.22.0Path must be a string.TypeError: Path must be a string. at Function.resolveSync [as sync] (D:\project\PDA20\node_modules\@umijs\utils\node_modules\resolve\lib\sync.js:51:15) ...原创 2020-03-07 15:32:24 · 6577 阅读 · 8 评论 -
React Native增加了新组建之后android studio报android.support.annotation.Nullable找不到
React Native引用了新控件之后android studio编译的时候android.support.annotation.Nullable报这个引用找不到,将其改为androidx.annotation.Nullable即可解决原创 2020-02-21 12:16:15 · 1301 阅读 · 0 评论 -
React Native Table 添加编辑按钮
constelement=(data,index)=>(<Viewstyle={{alignItems:'center',flexDirection:'row',justifyContent:'center'}}><TouchableOpacityonPress={()=>this._...原创 2020-01-16 09:58:14 · 401 阅读 · 0 评论 -
React Native编译成bundle文件命令
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/原创 2019-10-18 15:43:31 · 496 阅读 · 0 评论 -
Application has not been register
在热更新动态加载bundle 文件会出现程序未注册的情况,原因是动态加载bundle文件的时候没有将bundle加载进去,还是原来MainApplication加载的bundle文件,从而导致出现app应用程序未注册的情况解决办法:重新设置一下bundle路径private void setJSBundle(ReactInstanceManager instanceManager, St...原创 2019-09-25 16:37:36 · 493 阅读 · 0 评论 -
React Native 找不到NetInfo引用
在React Native 0.6版本中发现NetInfo引用不到,运行后报错,NetInfo is not an object解决方法①:yarn命令添加 yarn add@react-native-community/netinfo②:执行react-native link@react-native-community/netinfo命令引用importNetInfo...原创 2019-09-17 18:45:44 · 1266 阅读 · 0 评论 -
React Native 调用原生的android方法callback.invoke之后React获取不到返回值
在做RN分业务模块分包加载的时候,在子业务模块调用原生代码获取返回值发现调用原生的方法可以,但是一直不回调RN的代码返回值给RN页面,后面发现原来在子业务模块是不可以有返回值的,切换到主bundle文件里面调用一切正常。...原创 2019-09-04 15:05:05 · 1158 阅读 · 0 评论