carousel fixes
This commit is contained in:
parent
d7096c5dd1
commit
d567d33158
@ -79,6 +79,7 @@ open class Carousel: View {
|
|||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.layoutCollection()
|
self.layoutCollection()
|
||||||
}
|
}
|
||||||
|
collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Invalidates the layout and ensures we are paged to the correct cell.
|
/// Invalidates the layout and ensures we are paged to the correct cell.
|
||||||
@ -386,6 +387,10 @@ open class Carousel: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension Carousel: UICollectionViewDelegateFlowLayout {
|
extension Carousel: UICollectionViewDelegateFlowLayout {
|
||||||
|
open func numberOfSections(in collectionView: UICollectionView) -> Int {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
open func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
open func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
|
||||||
let itemWidth = collectionView.bounds.width * itemWidthPercent
|
let itemWidth = collectionView.bounds.width * itemWidthPercent
|
||||||
return CGSize(width: itemWidth, height: collectionView.bounds.height)
|
return CGSize(width: itemWidth, height: collectionView.bounds.height)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user