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 ?
Asked
Active
Viewed 1,677 times
0

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

S.M_Emamian
- 17,005
- 37
- 135
- 254
-
use clear color – Prashant Tukadiya Mar 06 '17 at 04:37
-
releted this http://stackoverflow.com/questions/16570309/collectionview-background-clearcolor-not-working – Nazmul Hasan Mar 06 '17 at 04:54
2 Answers
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