This commit is contained in:
2025-11-17 15:06:05 +08:00
parent 1d215ffdb3
commit dc813fcabc
5 changed files with 21 additions and 8 deletions

View File

@@ -52,9 +52,10 @@ static NSString * const kResultCellId = @"KBSkinCardCell";
[self.searchBarView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.backButton);
make.left.equalTo(self.backButton.mas_right).offset(12);
make.width.mas_equalTo(315);
// make.width.mas_equalTo(315);
make.height.mas_equalTo(36);
make.right.lessThanOrEqualTo(self.topBar).offset(-16);
// make.right.lessThanOrEqualTo(self.topBar).offset(-16);
make.right.equalTo(self.view).offset(-16);
}];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.topBar.mas_bottom).offset(12);
@@ -119,8 +120,8 @@ static NSString * const kResultCellId = @"KBSkinCardCell";
CGFloat inset = 16; //
CGFloat spacing = 12; //
CGFloat w = floor((width - inset * 2 - spacing) / 2.0);
CGFloat h = w * 0.75 + 8 + 20 + 10 + 6 + 8; // KBSkinCardCell
return CGSizeMake(w, h);
// CGFloat h = w * 0.75 + 8 + 20 + 10 + 6 + 8; // KBSkinCardCell
return CGSizeMake(w, KBFit(197));
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {