-1

I am using a CollectionView with horizontal alignment to display items. If there are multiple cells in collectionview, then user can scroll to view all of them. But if there's only one item in collectionview it is aligned to left side, is there a way I can align it to center for single item, like:

x x x 0 x x x

now its like:

0 x x x x x x

S.S.D
  • 1,579
  • 2
  • 12
  • 23

1 Answers1

0

Set size of your collection view cell to be equal to the collection view. And also, make sure the content in your cell is wrapped in the center of the cell.

Remember to disable horizontal scroll in this case.

jacob
  • 1,024
  • 9
  • 14