RN 第三方组件

作者: 寒飌 | 来源:发表于2019-02-15 15:06 被阅读0次

    rn-splash-screen 解决白屏

    react-native-view-shot 截屏

    "react-native-communications": "^2.2.1",电话、短信、邮件、浏览器

    动画

    https://www.jianshu.com/p/7fd37d8ed138

    项目中使用到的第三方库,感谢这些作者:

    极光推送:https://github.com/jpush/jpush-react-native

    emoji表情:https://github.com/omnidan/node-emoji

    高德定位:https://github.com/qiuxiang/react-native-amap-geolocation

    录音:https://github.com/jsierles/react-native-audio

    模糊视图:https://github.com/react-native-community/react-native-blur

    相机:https://github.com/react-native-community/react-native-camera

    热更新:https://github.com/Microsoft/react-native-code-push

    通讯录:https://github.com/rt2zz/react-native-contacts

    element-ui:https://github.com/react-native-training/react-native-elements

    文件传输:https://github.com/wkh237/react-native-fetch-blob

    iap:https://github.com/dooboolab/react-native-iap

    图片选择器,这里有两个,各有特点:

    1.https://github.com/react-community/react-native-image-picker

    2.https://github.com/ivpusic/react-native-image-crop-picker

    图片缓存:https://github.com/wcandillon/react-native-img-cache

    进度条:https://github.com/oblador/react-native-progress

    二维码生成:https://github.com/cssivision/react-native-qrcode

    二维码扫描:https://github.com/moaazsidat/react-native-qrcode-scanner

    滚动tab:https://github.com/happypancake/react-native-scrollable-tab-view

    音频播放:https://github.com/zmxv/react-native-sound

    加载动画:https://github.com/maxs15/react-native-spinkit

    启动白屏解决:https://github.com/crazycodeboy/react-native-splash-screen

    icon:https://github.com/oblador/react-native-vector-icons

    视频播放:https://github.com/react-native-community/react-native-video

    本地视频压缩(目前好像只支持IOS,安卓有报错):https://github.com/shahen94/react-native-video-processing

    微信SDK:https://github.com/yorkie/react-native-wechat

    很不错的UI库:https://github.com/rilyu/teaset

    聊天UI:https://github.com/FaridSafi/react-native-gifted-chat

    RN bundle拆分

    https://www.jianshu.com/p/8711c241a9b8?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

    https://github.com/smallnew/react-native-multibundler

    https://www.jianshu.com/p/191db8d1eea4

    https://www.jianshu.com/p/6e4fc17de66d

    https://www.jianshu.com/p/ab94a94d58bb

    http://androidev.coding.me/2017/09/06/react-native-bundle/

    https://github.com/songxiaoliang/react-native-split-bundle

    流程图

    https://github.com/24ark/react-native-step-indicator

    https://github.com/thegamenicorus/react-native-timeline-listview

    倒计时

    https://www.jianshu.com/p/f5925a95c01b 倒计时
    RN

    https://github.com/crazycodeboy/react-native-splash-screen 白屏

    https://www.cnblogs.com/yexiaochai/p/6042112.html 资源

    https://www.jianshu.com/p/be653685235f 自动打包

    https://www.jianshu.com/u/27a084d3e8ce 树形图

    https://www.jianshu.com/p/fa0874be0827/ 详细入门

    RN真机调试,需要把localhost改成本机的IP地址就可以了

    RN导航

    https://cloud.tencent.com/developer/article/1038523

    混合开发

    https://cloud.tencent.com/developer/article/1346931

    https://linkrober.github.io/bookshelf/2017/10/react-native和native间的通信/

    react native 防京东商品详情的上拉下拉的效果

    https://blog.csdn.net/vv_bug/article/details/79781226

    iOS库

    https://github.com/Tim9Liu9/TimLiu-iOS

    https://github.com/ChenYilong/iOSInterviewQuestions/blob/master/01《招聘一个靠谱的iOS》面试题参考答案/《招聘一个靠谱的iOS》面试题参考答案(上).md

    基本语法
    https://www.jianshu.com/p/49a2f6d04de4

    路由navigation
    https://snack.expo.io/Sk1zWsYZE

    React Native中的懒加载 (lazyload)
    https://github.com/magicismight/react-native-lazyload
    特性
    纯javascript解决方案
    只需要在原有代码的基础上进行一点点的改动就可以轻松实现界面、图片的懒加载
    支持预加载距离设置
    支持加载动画
    支持长列表、长ScrollView未显示子元素的内存自动回收
    健全的算法与缓存机制使得javascript线程性能飞快(不会因为滚动计算而造成js线程阻塞,1000个子元素的长列表,每次滚动js计算耗时控制在0~1ms之间)
    使用

    引入
    import {
    LazyloadScrollView,
    LazyloadListView,
    LazyloadView,
    LazyloadImage
    } from 'react-native-lazyload';

    替换
    使用 LazyloadScrollView 替换需要实现懒加载的 ScrollView,LazyloadListView 替换 ListView
    LazyloadView替换需要被懒加载的View,LazyloadImage 替换Image
    LazyloadScrollView,LazyloadListView 的用法与ScrollView,ListView完全一样

    关联元素
    给 LazyloadScrollView或LazyloadListView 添加 name 属性,并给LazyloadView, LazyloadImage添加与之对应的host属性
    特别注意:

    所有LazyloadView, LazyloadImage需要在 LazyloadScrollView或LazyloadListView 内,并指定与之 name 属性相同的 host属性才能使懒加载生效,因为React不能实现元素的遍历,需要通过指定这两个属性建立懒元素与滚动元素之间的对应关系
    LazyloadView与LazyloadImage需要设定固定的宽高,否则它们被自动回收时会造成Scroll内容的闪动
    一段简单的示意代码如下:

    <LazyloadScrollView name="scroll">
    <View>
    <LazyloadView style={styles.view} host="scroll">
    <Text>懒加载的内容</Text>
    </LazyloadView>
    </View>
    ...其他元素
    <LazyloadImage style={styles.image} source={...图片地址} host="scroll" />
    </LazyloadScrollView>
    注意LazyloadScrollView的name属性与LazyloadView和LazyloadImage的host属性的对应关系

    相关文章

      网友评论

        本文标题:RN 第三方组件

        本文链接:https://www.haomeiwen.com/subject/wazpeqtx.html