Wednesday, July 3, 2024
HomeiOS Developmentios - Methods to make it possible for supplementary view in UICollectionView...

ios – Methods to make it possible for supplementary view in UICollectionView is all the time rendered utilizing customized format


I’m attempting to implement sticky footers in customized format (we won’t use stream format). And there are circumstances the place footer is hidden briefly.

I’m subclassing UICollectionViewLayout. I’ve carried out layoutAttributesForElements(in rect: CGRect), layoutAttributesForItem(at indexPath: IndexPath) and layoutAttributesForSupplementaryView(ofKind elementKind: String, at indexPath: IndexPath) – so mainly all essential overrides are there.

shouldInvalidateLayout(forBoundsChange newBounds: CGRect) returns true and shouldInvalidateLayout(forPreferredLayoutAttributes preferredAttributes: UICollectionViewLayoutAttributes, withOriginalAttributes originalAttributes: UICollectionViewLayoutAttributes) returns true if peak modifications.

in rect methodology returns legitimate footer attributes each time. Nevertheless, I’ve seen a bizarre animation glitch if I spring load assortment view on the prime after which fling it quick. Footer will rapidly fade away whereas scrolling along with the content material and reappear in proper place instantly. When debugging I seen that finalLayoutAttributesForDisappearingSupplementaryElement is named for the footer and that will clarify why fade animation is triggered.

I’ve seen that returning format attributes the place peak is ready to 0 leads to view not getting dequeued, however this isn’t the case for that footer.

How am i able to stop the view from getting right into a state the place UICollectionView needs to cover it?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments