0

I would like to just show my cell's but when I using collection view it show a white background. is there any way to remove white background to nothing ?

enter image description here

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
S.M_Emamian
  • 17,005
  • 37
  • 135
  • 254

2 Answers2

1

setting the color to clear and the background view to an empty view . call the following line in viewDidLoad

self.yourcollectionViewName?.backgroundColor = UIColor.clear
self.yourcollectionViewName?.backgroundView = UIView(frame: CGRect.zero)

or another choice with out code

go to inspector Attribute, select the background color field in the storyboard and Change it to Clear Color.

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
-1

You can set the backgroundColor to .clear:

cell.contentView.backgroundColor = UIColor.clear
FelixSFD
  • 6,052
  • 10
  • 43
  • 117
Saurabh Sharma
  • 1,671
  • 2
  • 13
  • 16