You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using FSPagerView inside a UITableView, just as it was a CollectionView from this article
However, I can't find a way to set the contentOffset of the pagerView as I would for a collectionView (collectionView.contentOffset.x = newValue), to ensure that when my tableView cells are reused, the offset are preserved and my pagerView is displayed with the right currentIndex.
Basically, I would like to set the pagerView current displayed index in my tableView WillDisplayCell method, but as I try using scrollToItem it crashes with an index out of range issue showing that numberOfItems is still 0, as its data was not loaded yet.
Any idea how to accomplish that? Hope I'm clear enough, thanks for your help!
The text was updated successfully, but these errors were encountered:
The content offset is useless if your collectionView hasn't layout it's content. Typically you should set the content offset in viewDidLayoutSubviews function of your view controller, or force the collection view layout before scrolling by calling layoutIfNeeded(). In this case, the following code could be helpful.
Hi,
I'm currently using
FSPagerView
inside aUITableView
, just as it was aCollectionView
from this articleHowever, I can't find a way to set the
contentOffset
of thepagerView
as I would for acollectionView
(collectionView.contentOffset.x = newValue
), to ensure that when mytableView
cells are reused, the offset are preserved and mypagerView
is displayed with the rightcurrentIndex
.Basically, I would like to set the pagerView current displayed index in my tableView
WillDisplayCell
method, but as I try usingscrollToItem
it crashes with an indexout of range
issue showing thatnumberOfItems
is still 0, as its data was not loaded yet.Any idea how to accomplish that? Hope I'm clear enough, thanks for your help!
The text was updated successfully, but these errors were encountered: