locked
I have 3 image in one row .from ever 3 item i need increase collection view height and table view . RRS feed

  • Question

  • User306227 posted

    I have 3 image in one row .from ever 3 item i need increase collection view height and table view .

    this is my code

           if (AllImageArr.Count >= 3)
            {
                collectionViewHeightConstraint.Constant = AllImageArr.Count * 50 + AllImageArr.Count * 2 * 5;
                parentVC.Target.collectionViewHeight = collectionViewHeightConstraint.Constant - 30;
    
            }
            else
            {
                collectionViewHeightConstraint.Constant = 100;
            }
    

    but for next row every-time its increase collectionview height


    Sunday, June 7, 2020 3:18 PM

All replies

  • User380187 posted

    Hi @Amejack , from shared code ,AllImageArr.Count >= 3 means that the count of ImageArray will change the height of all the items .

    If need to above 3 items to increase the item height of CollectionView or TableView , you can do something about position :smile:

    if (position >= 3) {
         items[position].height = ...;
    }else{
        items[position].height = ...;
    }
    
    Monday, June 8, 2020 9:39 AM
  • User380187 posted

    Hi @Amejack , have you solved this problem ? You can share the remaining problems here .

    Wednesday, June 17, 2020 7:46 AM