abdullahselek / ASCollectionView

Lightweight custom collection view inspired by Airbnb.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can i change cell size and pattern

krutitrivedi opened this issue · comments

screen shot 2018-03-19 at 2 08 23 pm
i only want pattern like shown in above screenshort

Hi @krutitrivedi you can change sizes of header, grid cell and parallax cell with reaching to collectionview's layout. Take a look at sample code below try to modify.
let asCollectionViewLayout = collectionView.collectionViewLayout as? ASCollectionViewLayout
asCollectionViewLayout?.headerSize = CGSize(width: WIDTH_VALUE_YOU_WANT, height: HEIGHT_VALUE_YOU_WANT)
asCollectionViewLayout?.parallaxCellSize = CGSize(width: WIDTH_VALUE_YOU_WANT, height: HEIGHT_VALUE_YOU_WANT)
asCollectionViewLayout?.gridCellSize = CGSize(width: WIDTH_VALUE_YOU_WANT, height: HEIGHT_VALUE_YOU_WANT)

i am asking about the formatting of the cell as shown in above screenshort
i want one image in first row and in second row need two images

Run the sample app see how it looks like then try to modify the code base in order to your needs.