Skip to content

Commit

Permalink
优化会议UI
Browse files Browse the repository at this point in the history
(cherry picked from commit 1f4cd8646fd851b8e9c537513989f8225859f15d)
  • Loading branch information
heavyrian2012 committed Oct 13, 2022
1 parent 93dbce5 commit f7a811c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -51,7 +51,7 @@ - (void)setProfiles:(NSMutableArray<WFAVParticipantProfile *> *)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;
Expand Down Expand Up @@ -83,9 +83,9 @@ - (void)setProfiles:(NSMutableArray<WFAVParticipantProfile *> *)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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,10 @@ - (BOOL)onDeviceOrientationDidChange{
break;

case UIDeviceOrientationPortrait:
default:
self.view.transform = CGAffineTransformMakeRotation(0);
[self updateUIByOrientationChanged:NO];
break;

default:
break;
}
return YES;
}
Expand Down

0 comments on commit f7a811c

Please sign in to comment.