高度随每片内容的高度变化的swiper react-native-unfixed-height-swiper

高度随每片内容的高度变化的swiper    
react-native-unfixed-height-swiper
 

内容可以文本 图片 视频 

本例里面的为文本   

使用方式
1. npm i react-native-unfixed-height-swiper --save-dev
2. 给组件传入文本数组,每个元素为对象{contents:'',name:''} 即可
3. detailPlots:[{index : 0,name : '填补中',contents : '由于作者过于懒惰 '},
                        {index : 1,name : '填补中',contents : '由于作者过于懒惰 '},
                        {index : 2,name : '填补中',contents : '由于作者过于懒惰'}]
 
4. <DetailSwiper detailPlotNumber={this.state.detailPlotNumber} detailPlots={this.state.detailPlots} />    
 

欢迎pull request

性能不错
 

推荐将代码直接插入自己项目中 而不是require
这是因为要刷新 放入项目中的话 刷新会快很多

因为是父子组件  如果想跳过初始的默认数据阶段  就将@/lib/detailPlots的代码放入项目中  这样能很快的加载数据 

github地址:
https://github.com/raintoway/react-native-unfixed-height-Swiper/tree/master/react-native-unfixed-height-Swiper
————————————————
版权声明:本文为CSDN博主「qq_41590147」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_41590147/article/details/103198957

猜你喜欢

转载自www.cnblogs.com/raintoway/p/11910976.html