backgroundViewScrollsWithContent
A Boolean value that indicates whether the collection view’s background view scrolls with the items and other content.
Declaration
var backgroundViewScrollsWithContent: Bool { get set }Discussion
The default value of this property is false, which means that backgroundView (if it exists) fills the collection view’s visible area and remains stationary when the collection view’s content is scrolled. When the value of this property is true, backgroundView matches the collection view’s frame and scrolls with the collection view’s items and other content.
Changing the value of this property also changes the background view’s parent. When backgroundView floats behind the scrolling content, it is a sibling of the collection view’s clip view. When it scrolls with the collection view’s content, it is a subview of the collection view.