Open yasirtahir opened 8 years ago
please, use "HWSwiftyViewPager"
Hello, I have used the same which you have mentioned https://github.com/vowed21/HWSwiftyViewPager but still I am facing the issue on every device i.e., the middle item is always skipped.
Can you please guide me accordingly?
To Solve above issue implement <UICollectionViewDelegateFlowLayout>
in HWViewPager.m
file.
@interface HWViewPager() <UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
.....
And implement following methods.
-(CGSize)collectionView:(UICollectionView )collectionView layout:(UICollectionViewLayout )collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewFlowLayout flow = (UICollectionViewFlowLayout) collectionView.collectionViewLayout;
CGFloat widthNew = collectionView.frame.size.width - (flow.sectionInset.left *2) - flow.minimumLineSpacing;
CGFloat heightNew = collectionView.frame.size.height - flow.sectionInset.top - flow.sectionInset.bottom;
return CGSizeMake(widthNew, heightNew);
}
Thank you
Hi,
Well, I have implemented your code in my application which is SWIFT based app. It is working perfectly fine on iPhone 4s, 5, and 5s. But when I am trying to run it on iPhone 6, or above, it is not working perfectly fine. Suppose if there are three items in the collection, and when I try to scroll to the second one, it will skip the second and moved directly to the third one. Similarly, If I try to get back to the second one, It will move directly to the first one.
In short, In a single to and fourth movement, the middle item is always skipped.
Can you please guide me accordingly?