WSL_RollView icon indicating copy to clipboard operation
WSL_RollView copied to clipboard

有时出现空白

Open AllenYL opened this issue 7 years ago • 1 comments

有时候在另一个界面停留一些时间,从另一个界面返回来,发现出现空白

AllenYL avatar Dec 20 '18 08:12 AllenYL

/** 水平方向跑马灯 分页/渐进动画 */

  • (void)horizontalRollAnimation{ // 没有滚动新闻时退出 if (_collectionView.contentSize.width == 0){ return; } [self resetContentOffset]; if (self.scrollStyle == WSLRollViewScrollStylePage){ //分页动画 NSInteger currentMiddleIndex= [_collectionView indexPathForItemAtPoint:CGPointMake(_collectionView.contentOffset.x + self.frame.size.width/2, 0)].row; NSIndexPath * nextIndexPath = [NSIndexPath indexPathForRow:(currentMiddleIndex + 1) inSection:0]; [_collectionView scrollToItemAtIndexPath:nextIndexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES]; }else if (self.scrollStyle == WSLRollViewScrollStyleStep){ //渐进动画 if ((_collectionView.contentOffset.x + _speed * 1.0/60)>_collectionView.contentSize.width) { [_collectionView setContentOffset:CGPointMake(0, _padding.top) animated:NO]; }else{ [_collectionView setContentOffset:CGPointMake(_collectionView.contentOffset.x + _speed * 1.0/60, _padding.top) animated:NO]; } } }

应该是这个地方的问题,我现在没出现空白了

TianXuang avatar Jul 09 '19 03:07 TianXuang