0

I want to create layout for following layout inside collection view.

Scale Flow Layout

Align one cell in centre and two cell outside with scale down using transform.

I have used third party library DXScaleFlowLayout and implemented following code to make like same.

let scaleLayout = DXScaleFlowLayout()
scaleLayout.transformScale = 0
scaleLayout.isPagingEnabled = true
scaleLayout.minimumAlpha = 0.8
scaleLayout.minimumLineSpacing = 0
scaleLayout.minimumInteritemSpacing = 0
    
let width = self.cvBusinessPlans.bounds.width
let height = self.cvBusinessPlans.bounds.height
scaleLayout.itemSize = CGSize(width: width, height: height)
    
scaleLayout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
    
self.cvBusinessPlans.collectionViewLayout = scaleLayout

But it didn't work for me. If anyone know how to make this then please help. I have search of SOF, but I can't find exact or similar solution.

Sagar Chauhan
  • 5,715
  • 2
  • 22
  • 56
  • I didn't test it, but: `scaleLayout.transformScale = 0` that seems to be **THE** property to set with a value different from `0.0`. – Larme Dec 07 '20 at 08:24
  • @Larme I have set it to 0.15, but didn't work. – Sagar Chauhan Dec 07 '20 at 08:26
  • And what's your output? What's `self.cvBusinessPlans.bounds` when it's called? Where is it called? Where is set your scaledLayout exactly? I guess it works on the SampleApp (https://github.com/SiriDx/DXScaleFlowLayout/blob/master/Example/Example/ViewController.swift) so, check the differences from the call order. – Larme Dec 07 '20 at 08:28
  • @Larme I have used sample app. It's working fine but cell around centre are not for my requirement. https://imgur.com/mYLNIDA. When I have tried to change values it not work as sample. – Sagar Chauhan Dec 07 '20 at 08:55
  • What’s your current output? It’s unclear the « not working ». Which part exactly? – Larme Dec 07 '20 at 08:57
  • @Larme, here is my current output. https://imgur.com/yF8qgbA – Sagar Chauhan Dec 07 '20 at 09:01
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/225612/discussion-between-sagar-chauhan-and-larme). – Sagar Chauhan Dec 07 '20 at 09:08

0 Answers0