0
点赞
收藏
分享

微信扫一扫

iOS 获取scrollView将要 停止拖动的时候的目标便宜量, 实现抖音无缝播放效果

微笑沉默 2022-02-12 阅读 54
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
-{   
	  /// 获取当前索引
	 NSInteger currentIndex = (*targetContentOffset).y/scrollView.bounds.size.height;
	 [self playTheVideoAtIndexPath:[NSIndexPath indexPathForRow:currentIndex inSection:0]];
}

举报

相关推荐

0 条评论