UICollectionView - How to set background color of a row
问题 I have a UICollectionView and only one section. Is there a way to set the background color of every row? (in my case it would be a gradient from black to white) 回答1: CollectionViews don't really have a concept of a rows because it's designed to have a flexible layout. Your best option is likely to have the background of the cells have your pattern and remove all the padding/margin between the cells. This will be a problem if the last row isn't full, so if the number needs to be flexible you