From 0d6ef08772813702ee1c53803f42421a904178cc Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Tue, 14 Nov 2017 18:43:05 +0100 Subject: [PATCH] Fix UICollectionView warning: The behavior of the UICollectionViewFlowLayout is not defined... --- Riot/ViewController/HomeViewController.m | 5 +++-- .../TableViewCell/TableViewCellWithCollectionView.h | 1 + .../TableViewCell/TableViewCellWithCollectionView.m | 2 ++ .../TableViewCellWithCollectionView.xib | 13 +++++++------ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Riot/ViewController/HomeViewController.m b/Riot/ViewController/HomeViewController.m index 912a30e27..4d1fc337e 100644 --- a/Riot/ViewController/HomeViewController.m +++ b/Riot/ViewController/HomeViewController.m @@ -277,7 +277,8 @@ if (indexPath.section == selectedSection) { // Show edition menu - tableViewCell.editionViewHeightConstraint.constant = 65; + tableViewCell.editionViewHeightConstraint.constant = 60; + tableViewCell.editionViewBottomConstraint.constant = 5; tableViewCell.editionView.hidden = NO; MXRoom *room = [self.mainSession roomWithRoomId:editedRoomId]; @@ -334,7 +335,7 @@ } // Retrieve the fixed height of the collection view cell used to display a room. - CGFloat height = [RoomCollectionViewCell defaultCellSize].height; + CGFloat height = [RoomCollectionViewCell defaultCellSize].height + 1; // Check the conditions to display the edition menu if (editedRoomId && indexPath.section == selectedSection) diff --git a/Riot/Views/TableViewCell/TableViewCellWithCollectionView.h b/Riot/Views/TableViewCell/TableViewCellWithCollectionView.h index a3a2970f0..aa71ab9d4 100644 --- a/Riot/Views/TableViewCell/TableViewCellWithCollectionView.h +++ b/Riot/Views/TableViewCell/TableViewCellWithCollectionView.h @@ -22,6 +22,7 @@ @property (strong, nonatomic) IBOutlet UIView *editionView; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *editionViewHeightConstraint; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *editionViewBottomConstraint; @property (weak, nonatomic) IBOutlet UIButton *directChatButton; @property (weak, nonatomic) IBOutlet UIImageView *directChatImageView; @property (weak, nonatomic) IBOutlet UIButton *notificationsButton; diff --git a/Riot/Views/TableViewCell/TableViewCellWithCollectionView.m b/Riot/Views/TableViewCell/TableViewCellWithCollectionView.m index ee583e21e..f884672b5 100644 --- a/Riot/Views/TableViewCell/TableViewCellWithCollectionView.m +++ b/Riot/Views/TableViewCell/TableViewCellWithCollectionView.m @@ -24,6 +24,7 @@ [super awakeFromNib]; self.editionViewHeightConstraint.constant = 0; + self.editionViewBottomConstraint.constant = 0; } - (void)customizeTableViewCellRendering @@ -42,6 +43,7 @@ self.collectionView.delegate = nil; self.editionViewHeightConstraint.constant = 0; + self.editionViewBottomConstraint.constant = 0; self.editionView.hidden = YES; self.collectionView.scrollEnabled = YES; diff --git a/Riot/Views/TableViewCell/TableViewCellWithCollectionView.xib b/Riot/Views/TableViewCell/TableViewCellWithCollectionView.xib index 416f0be8b..5e7bf09b0 100644 --- a/Riot/Views/TableViewCell/TableViewCellWithCollectionView.xib +++ b/Riot/Views/TableViewCell/TableViewCellWithCollectionView.xib @@ -1,25 +1,25 @@ - + - + - + - + - + @@ -29,7 +29,7 @@