使UICollectionView从右向左滚动? [英] Make UICollectionView scroll right to left?
本文介绍了使UICollectionView从右向左滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
UICollectionView在水平设置时滚动的自然方向是从左到右。有什么办法可以扭转这种情况吗?更简单的越好。
解决方案
我不知道你的意思 - 如果你设置滚动到水平,滚动同样好,左右。如果你想让它从右边开始,你可以使用这个方法:
[self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:self.theData.count - 1 inSection:0] atScrollPosition:UICollectionViewScrollPositionRight animated:NO];
这假设你有1节,填充集合视图的数组称为数据。 p>
The natural direction for a UICollectionView to scroll when set horizontally is from left to right. Is there any way to reverse this? The simpler the better.
解决方案
I'm not sure exactly what you mean -- if you set the scrolling to horizontal, it scrolls equally well, left and right. If you want it to start it from the right side, you can use this method:
[self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:self.theData.count - 1 inSection:0] atScrollPosition:UICollectionViewScrollPositionRight animated:NO];
This assumes that you have 1 section, and the array populating the collection view is called theData.
这篇关于使UICollectionView从右向左滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文