CristiCh
CristiCh

Reputation: 11784

iOS - Add border around a collection view cell and a view under it

There is a collection view cell and a view of the same size right under it.

Instead of separately adding two circle borders for both the cell and the view, I want to add one for them together (forming a rounded rectangle)

Is this possible?

If yes, how to handle the scrolling of the collection view?

Upvotes: 0

Views: 58

Answers (1)

skaak
skaak

Reputation: 3018

Yes it is possible but tricky.

I'd suggest you really try to combine it into one cell to avoid lots of headaches.

If you can not then you need to toy with the collection view layout to get your cell to line up correctly with the view underneath and you need to figure out the scrolling as you indicate.

I've sometimes had to use two consecutive collection view cells that needed to align and it was terrible to get it right, thus I suggest try to solve this problem using just a single cell. FWIW the last cell in a collection view often shifts slightly compared to the others so I've sometimes added a blank cell last just so my second to last will align correctly.

Upvotes: 1

Related Questions