ios - How to create a stack of cards with UICollectionView? -
the final effect want achieve this:
i did not know choose that, uicollectionview or create custom uiview? later decided choose uicollectionview.
the result got is:
for effect, used code:
if let layout = self.collectionview.collectionviewlayout as? uicollectionviewflowlayout { layout.scrolldirection = .horizontal layout.minimuminteritemspacing = -200.0 layout.sectioninset = uiedgeinsets(top: 0.0, left: 30.0, bottom: 0.0, right: 30.0) } and
cell.layer.zposition = -cgfloat(indexpath.row) to put them 1 under one. also, checked "paging enabled" checkbox.
but problem is:
i cannot scroll them , think it's because of layout.minimuminteritemspacing = -200.0. when scroll, 3 cards scroll together.
how can achieve effect in url? i'm doing wrong?

Comments
Post a Comment