CollectionView FlowLayout Warning

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • CollectionView FlowLayout Warning

    Hallo,

    ich habe aktuell ein ziemlich mysteriöses Problem mit dem FlowLayout. Obwohl die App genau so ausschaut wie ich mir das ganze vorstelle und auch alles funktioniert, sehe ich das Xcode eine Warnung in die Konsole hämmert die wie folgt lautet:

    The behavior of the UICollectionViewFlowLayout is not defined because:
    the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.

    Hat jemand vielleicht ne Ahnung wie ich diese Warnung los werden kann ?

    Betrifft diesen Code:

    Quellcode

    1. extension HomeTableViewCell: UICollectionViewDelegateFlowLayout {
    2. func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    3. let itemsPerRow:CGFloat = 2
    4. let hardCodedPadding:CGFloat = 5
    5. let itemWidth = (collectionView.bounds.width / itemsPerRow) + (2 * hardCodedPadding)
    6. let itemHeight = collectionView.bounds.height - (2 * hardCodedPadding)
    7. return CGSize(width: itemWidth, height: itemHeight)
    8. }
    9. }