Uicollectionview cell color rows and column

Hi everybody,

how can I color the cells that are in the same column and same row of selected cell?
To understand what I mean, look this image taken from google flights.

how can I do it?

You may want to provide more information (code preferably) about how you are doing things, in order for someone to help you. Otherwise, it’s just guessing.

I’m using this framework

to reproduce the spreadsheet, because I need to have to top and to right the headers. This framework create a layout to pass to collection view. and everything work perfectly but I need to color the cells that are up or right of the selected cell.

how can I do it?

While what you are asking isn’t an Issue. Sometimes challenging questions are placed in the Issues section of a repository in Github. Give that a try: Issues · stuffrabbit/SwiftSpreadsheet · GitHub

Thank you Roberto for the answer,
I thought it was something you could do regardless of the layout you were using. example to be able to color a row yes or no use this code:

cell.backgroundColor = indexPath.item % 2 == 1 ? self.lightGreyColor : UIColor.white

anyway, I’ll do as you suggested

This topic was automatically closed after 166 days. New replies are no longer allowed.