Open milap-eww opened 6 years ago
Hi @milap-eww could you remove this space?
Need the same!!
The same??
Sent from my iPhone
On Nov 1, 2018, at 8:21 PM, jp notifications@github.com wrote:
Need the same!!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Yeap! I use a vertical flow, but the it's the same issue/request. I need to remove the initial spacing at the top of the collection. Any thoughts?
@All,
let layout = UPCarouselFlowLayout() layout.itemSize = CGSize(width:UIScreen.main.bounds.size.width - 80, height:UIScreen.main.bounds.size.width - 80) layout.spacingMode = UPCarouselFlowLayoutSpacingMode.fixed(spacing: 10.0) self.collectionView.collectionViewLayout = layout self.rotationDidChange()
Remove space between two cell.
@suraj-ios The problem is not this, the problem is that in the first cell it has a large space between the margin and the cell, when we scroll in the collection it returns to the expected state.
If anyone has been able to solve it, please help. Thanks!
For vertical spacing, I was able to solve it by adding this -
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { return UIEdgeInsets(top: 2, left: 0, bottom: 0, right: 0) }
For me what helped was setting the itemSize
after layout was properly defined, so in a view controller you could write in viewDidLayoutSubviews
something like:
layout.itemSize = CGSize(width: view.frame.width, height: someHeight)
for horizontal scrolling.
@ALL
Try this, It worked for me
let indexPath = IndexPath(row: 2, section: 0) collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .centeredHorizontally)
for me was change the edge inset left to my desired value in method updateLayout
sectionInset = UIEdgeInsets(top: yInset, left: 20, bottom: yInset, right: xInset)
hope it helps someone! cheers!