0

I have a simple collection view which displays many cells in rows.

I would like to show a background image for each row of the collection view.

Is there a way to do it?

Note- A way to do this is to set the background view of the collection view to a UIImageView where the image is tiled (Repeat image horizontally and vertically)

Is there a better way to do this?

This question is similar to UICollectionView - How to set background color of a row

Note- What I am trying to do is similar to the below screenshot.enter image description here

I do not know how the above app was implemented. I am trying to do something similar using UICollectionView. The magazine images are the UICollectionViewCells. The magazines seem to be placed on a shelf. Each row has a shelf. I am trying to show the shelf image as the background image for the row so that the magazines seem to be placed on a shelf.

How does one show the shelf in the above image?

  • 1
    I imagine there are various approaches to this, but it may depend on exactly what your needs are. Are you designing a collection view in terms of a ***grid***? If so, are you designing for a fixed number of "columns"? Or will the cell's be a fixed size, so will have varying number of columns based on screen size / orientation? Do you want the "row" images to scroll? – DonMag Mar 18 '20 at 17:52
  • I will know the number of cells, number of rows and number of columns beforehand. The scrolling is disabled for the collection view. The size of the cells will be calculated such that all the cells fit within the frame of the collection view so that no scrolling is required. –  Mar 19 '20 at 04:13
  • which type of image would you like to show in row? – Jignesh Mayani Mar 19 '20 at 10:58
  • A background image ( a png image ). The cells have transparent background –  Mar 19 '20 at 12:44

0 Answers0