We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I used stretchy Header FlowLayout after import DisplaySwitcher my Header doesn't seem anymore?
import UIKit
class STCollectionViewFlowLayout: UICollectionViewFlowLayout {
override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { return true } override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { let layoutAttributes = super.layoutAttributesForElements(in: rect) layoutAttributes?.forEach({ (attributes) in if attributes.representedElementKind == UICollectionView.elementKindSectionHeader { guard let collectionView = collectionView else { return } let contentOffsetY = collectionView.contentOffset.y if contentOffsetY > 0 { return } let width = collectionView.frame.width let height: CGFloat = attributes.frame.height - contentOffsetY attributes.frame = CGRect(x: 0, y: contentOffsetY, width: width, height: height) } }) return layoutAttributes }
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I used stretchy Header FlowLayout
after import DisplaySwitcher my Header doesn't seem anymore?
import UIKit
class STCollectionViewFlowLayout: UICollectionViewFlowLayout {
}
The text was updated successfully, but these errors were encountered: