WSL_RollView
WSL_RollView copied to clipboard
滚动时候出现空白,indexPathForItemAtPoint计算时NSIndexPath为nil导致的row一直为0,_addRightCount一直为1的问题
导致问题的原因是CGPointMake(self.frame.size.width - 1,0)的y为0;不能获取到NSIndexPath; 将_addRightCount = [_collectionView indexPathForItemAtPoint:CGPointMake(self.frame.size.width - 1, 0)].row + 1 ; 改为 _addRightCount = [_collectionView indexPathForItemAtPoint:CGPointMake(self.frame.size.width - 1, self.frame.size.height / 2.0)].row + 1 ;
同理_addRightCount = [_collectionView indexPathForItemAtPoint:CGPointMake(0, self.frame.size.height - 1)].row + 1 ; 改为 _addRightCount = [_collectionView indexPathForItemAtPoint:CGPointMake(self.frame.size.width / 2.0, self.frame.size.height - 1)].row + 1 ;