0

I have a custom UICollectionViewLayout and I wanna draw a line over certain cell like in the image below:

enter image description here When I draw a line on collectionview, the line is lapping over the header cells which is something I do not want. Can you please suggest me what should I do?

Val Nolav
  • 908
  • 8
  • 19
  • 44
  • How are you drawing the line? Is it a separate `UIView`? – nathangitter Dec 01 '17 at 16:32
  • Yes, I add UIView currently. – Val Nolav Dec 01 '17 at 16:36
  • 1
    Can you post your relevant code? You should be able to constrain your view to the top of the collection view, offset by the height of the header. – nathangitter Dec 01 '17 at 16:40
  • Offsetting :) that is something I have not tought off. I got your point many thanks, I will try now!! – Val Nolav Dec 01 '17 at 16:42
  • Did offsetting the view work for you? – nathangitter Dec 01 '17 at 19:16
  • not really. I am trying to add constraints but getting this error: 'NSInternalInconsistencyException', reason: 'Impossible to set up layout with view hierarchy unprepared for constraint.' – Val Nolav Dec 01 '17 at 20:26
  • Take a look at this question: https://stackoverflow.com/q/26349234/6658553 If you are still running into issues, edit your question with your current code so myself or others will be more able to help. – nathangitter Dec 01 '17 at 20:53
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/160315/discussion-between-val-nolav-and-nathan). – Val Nolav Dec 01 '17 at 21:19

0 Answers0