当前位置:   article > 正文

iOS 获取scrollView将要 停止拖动的时候的目标偏移量, 实现抖音无缝播放效果_ios scrollview获取滚动结束时

ios scrollview获取滚动结束时
- (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]];
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/531496
推荐阅读
相关标签
  

闽ICP备14008679号