Upgrade to Pro — share decks privately, control downloads, hide ads and more …

UICollectionView自動布局

 UICollectionView自動布局

UICollectionView layout和self-sizing cell的介紹

Hai Feng Kao

March 27, 2018
Tweet

More Decks by Hai Feng Kao

Other Decks in Programming

Transcript

  1. 會⾃自⼰己調整⼤大⼩小的cell • layoutAttributesForElements(in:): • layoutAttributesForItem(at:): • cellForItemAt: • preferredLayoutAttributesFitting(_:) •

    shouldInvalidateLayout(forPreferred LayoutAttributes: withOriginalAttributes) • invalidationContext(forPreferredLayo utAttributes: withOriginalAttributes)