0

I'm currently building a collection view with a header, I've got all the pieces working, so I don't necessarily have a question/problem about code, header works fine and so do the cells. My question is about the header and when you drag it down, you can see the background color. Currently, I have my header's color set to Gray, and the background color of the controller is set to white, so when I drag the header down, I can see the white background.

My question is.. what code do I need to implement in order for the gray header to be continuously stuck to the top even as I drag the header down?

I'd like to figure how to implement this because I want to keep the spacing of my collection view cells white and not gray (If I were to change the background color to gray).

syds
  • 322
  • 3
  • 12
  • It would be helpful if you could add *some* code to your question, or at least screenshots that depict the problem. – brandonscript Jun 20 '19 at 17:45
  • https://stackoverflow.com/questions/16433007/uicollectionview-change-location-of-header maybe this answer will help you, and you should implement your own UICollectionViewLayout like inherit from UICollectionViewFlowLayout to control your view's position – zhoujialei Jun 21 '19 at 02:38

0 Answers0