From f7a811cf84614f1aafe52ef40cbd12c6a0f4df8c Mon Sep 17 00:00:00 2001 From: heavyrian2012 Date: Thu, 13 Oct 2022 09:30:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BC=9A=E8=AE=AEUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 1f4cd8646fd851b8e9c537513989f8225859f15d) --- .../Cell/WFCUConferenceAudioCollectionViewCell.m | 10 +++++----- .../Voip/Conference/WFCUConferenceViewController.m | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/wfuikit/WFChatUIKit/Voip/Conference/Cell/WFCUConferenceAudioCollectionViewCell.m b/wfuikit/WFChatUIKit/Voip/Conference/Cell/WFCUConferenceAudioCollectionViewCell.m index ec5d3cdc8..28953ecbb 100644 --- a/wfuikit/WFChatUIKit/Voip/Conference/Cell/WFCUConferenceAudioCollectionViewCell.m +++ b/wfuikit/WFChatUIKit/Voip/Conference/Cell/WFCUConferenceAudioCollectionViewCell.m @@ -28,9 +28,9 @@ - (instancetype)initWithFrame:(CGRect)frame { - (void)setupView:(CGRect)frame { UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init]; - CGFloat itemWidth = ([UIScreen mainScreen].bounds.size.width - flowLayout.minimumInteritemSpacing*2)/3; + CGFloat itemWidth = ([UIScreen mainScreen].bounds.size.width - flowLayout.minimumInteritemSpacing*2)/3-flowLayout.minimumLineSpacing; flowLayout.itemSize = CGSizeMake(itemWidth, itemWidth); - flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; +// flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; self.collectionView = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:flowLayout]; self.collectionView.dataSource = self; @@ -51,7 +51,7 @@ - (void)setProfiles:(NSMutableArray *)participants pag CGSize parentSize = self.bounds.size; int itemCount = MIN(12, self.participants.count - self.pages*12); - CGFloat itemWidth = (MIN(parentSize.width, parentSize.height) - flowLayout.minimumInteritemSpacing*2)/3; + CGFloat itemWidth = (MIN(parentSize.width, parentSize.height) - flowLayout.minimumInteritemSpacing*2)/3-flowLayout.minimumLineSpacing; CGFloat startX, startY, widht, height; @@ -83,9 +83,9 @@ - (void)setProfiles:(NSMutableArray *)participants pag } } else { if(itemCount == 1) { - startX = itemWidth; + startX = parentSize.width/2 - itemWidth/2; widht = itemWidth; - } else if(itemCount == 2) { + } else if(itemCount == 2 || itemCount == 4) { startX = itemWidth/2 - minimumInteritemSpacing/2; widht = itemWidth*2 + minimumInteritemSpacing; } else { diff --git a/wfuikit/WFChatUIKit/Voip/Conference/WFCUConferenceViewController.m b/wfuikit/WFChatUIKit/Voip/Conference/WFCUConferenceViewController.m index a583bfa5e..a9562584b 100644 --- a/wfuikit/WFChatUIKit/Voip/Conference/WFCUConferenceViewController.m +++ b/wfuikit/WFChatUIKit/Voip/Conference/WFCUConferenceViewController.m @@ -1121,12 +1121,10 @@ - (BOOL)onDeviceOrientationDidChange{ break; case UIDeviceOrientationPortrait: + default: self.view.transform = CGAffineTransformMakeRotation(0); [self updateUIByOrientationChanged:NO]; break; - - default: - break; } return YES; }