This commit is contained in:
2026-02-04 15:40:45 +08:00
parent 7c7e2477cb
commit c1b50b407d
13 changed files with 146 additions and 32 deletions

View File

@@ -70,12 +70,15 @@ static NSString * const kKBSvipBenefitBgKind = @"KBSvipBenefitBgDecoration"; //
UIEdgeInsets sectionInset0 = [self insetForSection:0];
UIEdgeInsets sectionInset1 = [self insetForSection:1];
// 1. 18 Section 0 Section 1
// Section inset
CGFloat outerPadding = 16;
// 1. 18 16
{
CGFloat minY = CGRectGetMinY(firstItemAttr.frame) - sectionInset0.top;
CGFloat maxY = CGRectGetMaxY(lastBenefitAttr.frame) + 16;
CGFloat x = sectionInset0.left;
CGFloat width = self.collectionView.bounds.size.width - sectionInset0.left - sectionInset0.right;
CGFloat x = outerPadding;
CGFloat width = self.collectionView.bounds.size.width - outerPadding * 2;
CGRect frame = CGRectMake(x, minY, width, maxY - minY);
@@ -87,10 +90,11 @@ static NSString * const kKBSvipBenefitBgKind = @"KBSvipBenefitBgDecoration"; //
// 2. 15 Section 1 Header Section 1 8px
{
CGFloat innerPadding = 8; //
CGFloat minY = CGRectGetMinY(benefitHeaderAttr.frame);
CGFloat maxY = CGRectGetMaxY(lastBenefitAttr.frame) + 16;
CGFloat x = sectionInset0.left + 8; // 8px
CGFloat width = self.collectionView.bounds.size.width - sectionInset0.left - sectionInset0.right - 16; // 8px
CGFloat x = outerPadding + innerPadding;
CGFloat width = self.collectionView.bounds.size.width - (outerPadding + innerPadding) * 2;
CGRect frame = CGRectMake(x, minY, width, maxY - minY);