RN笔记

1、点击空白处收起键盘,在组件最外层加上 即可

2、使用阿里的提示插件,@ant-design/react-native 在外层加上 ,否则提示框不出现

3、不使用button组件,在安卓、iOS样式差距巨大,使用 TouchableOpacity等代替

4、要在一个栈里面跳转,需要先注册路由

5、不使用绝对布局,使用Flex布局,使用绝对布局点击事件之类有可能会在安卓机器上失效,

6、配置Androidstudio 时,gradle Build的时候一直报超时或者refuse,jar包下载不下来,
原因: /Users/zhusongze/.gradle/gradle.properties 这个文件设置了代理,里面代理注释掉,干干净净就可以跑了

7、Android studio 报 failed linking references 可能是版本原因,
Studio在打包的时候会检测所有module中的support包,对于不同版本的情况,最终取最高版本的support包来为所有module进行编译。
原因知道了,解决办法就简单了,要么升sdk版本,要么降support版本。
https://blog.csdn.net/flyfight88/article/details/83088137

8、理解this概念 https://juejin.im/post/5c96d0c751882511c832ff7b

9、ReactNative使用支付宝支付报错:方法不会覆盖或实现超类型的方法
react-native-yunpeng-alipay 【https://blog.csdn.net/sinat_30949835/article/details/78903007】
进入这个文件夹注释中间一段代码

android>src>main>java>com.yunpeng.alipay>AlipayPackage 
/**
* Created by m2mbob on 16/5/6.
*/
public class AlipayPackage implements ReactPackage {

   @Override
   public List createNativeModules(ReactApplicationContext reactContext) {
       List modules = new ArrayList<>();
       modules.add(new AlipayModule(reactContext));
       return modules;
   }

//    @Override
//    public List> createJSModules() {
//        return Collections.emptyList();
//    }

   @Override
   public List createViewManagers(ReactApplicationContext reactContext) {
       return Collections.emptyList();
   }

}

10、一直报core-js找不到啥$html, 按下面操作即可

https://github.com/react-toolbox/react-toolbox/issues/127
 Try delete your node_modules folder. Then run npm install core-js, and then do npm install.

11、WebView出现莫名黑边, backgroundColor:'rgba(255, 255, 255, 0.0)’ 背景色设置透明即可

12、微信支付 按文档处理,
https://github.com/yorkie/react-native-wechat
安卓处理
https://github.com/yorkie/react-native-wechat/blob/master/docs/build-setup-android.md

13、 https://www.jianshu.com/p/1d32c8f0202b 兼容下Android 9

14、
Unrecognized font family 'antoutline'
运行命令 react-native link @ant-design/icons-react-native

15、微信分享,qq分享

安卓配置
xml文件,MainApplication.java文件

iOS配置
delegate文件,URL文件,
QQ那项由tencent后面数字10进制转16进制,补0补足8位

16、 安卓版本更新
https://github.com/songxiaoliang/react-native-app-upgrade

你可能感兴趣的:(RN笔记)