设为首页 加入收藏

TOP

React Native 之ScrollView轮播图实现(三)
2017-10-13 10:49:41 】 浏览:766
Tags:React Native ScrollView 实现
sp;        onMomentumScrollEnd={(e)=>{this._onAnimationEnd(e)}}             //开始拖拽             onScrollBeginDrag={()=>{this._onScrollBeginDrag()}}             //结束拖拽             onScrollEndDrag={()=>{this._onScrollEndDrag()}}             >             {this._renderAllImage()}           </ScrollView>           <View style={styles.pageViewStyle}>            {this._renderAllIndicator()}           </View>         </View>       );     }     /**开始拖拽 */     _onScrollBeginDrag(){       console.log("开始拖拽");       //两种清除方式 都是可以的没有区别       // this.timer && clearInterval(this.timer);       this.timer && clearTimeout(this.timer);     }     /**停止拖拽 */     _onScrollEndDrag(){       console.log("停止拖拽");       this.timer &&this._startTimer();     }        /**1.轮播图片展示 */     _renderAllImage() {       let allImage = [];       let imgsArr = ImageData.data;       for (let i = 0; i < imgsArr.length; i++) {         let imgsItem = imgsArr[i];        allImage.push(           <Image key={i} source={{uri:imgsItem.icon}} style={styles.imageStyle} />         );       }       return allImage;     }          /**2.手动滑动分页实现 */     _onAnimationEnd(e) {       //求出偏移量       let offsetX = e.nativeEvent.contentOffset.x; &nbs
首页 上一页 1 2 3 4 5 下一页 尾页 3/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇图片的懒加载问题 下一篇html锚点 点击跳转到页面指定位置

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目