Home UICollectionView scrolls out of view when scrollToItemAtIndexPath
Reply: 0

UICollectionView scrolls out of view when scrollToItemAtIndexPath

user705
1#
user705 Published in June 20, 2018, 7:24 am

I am having trouble with the scrollToItem(at:at:animated:) method in my collectionView. When scrolling to the last item, it seems as the collectionView scrolls out of view. When I try to scroll up after that, then collectionView is at the bottom.

NSInteger section = [self numberOfSectionsInCollectionView:collectionView] - 1;

NSInteger item = [self collectionView:collectionView numberOfItemsInSection:section] - 1;

NSIndexPath *lastIndexPath = [NSIndexPath indexPathForItem:item inSection:section];

[collectionView scrollToItemAtIndexPath:lastIndexPath atScrollPosition:UICollectionViewScrollPositionBottom animated:YES];

Example Video

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.400295 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO