增加换肤功能

This commit is contained in:
启星
2025-08-14 10:07:49 +08:00
parent f6964c1e89
commit 4f9318d98e
8789 changed files with 978530 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
//
// ZLCollectionViewLayoutAttributes.m
// ZLCollectionView
//
// Created by zhaoliang chen on 2018/7/9.
// Copyright © 2018 zhaoliang chen. All rights reserved.
//
#import "ZLCollectionViewLayoutAttributes.h"
#import "ZLCollectionReusableView.h"
@implementation ZLCollectionViewLayoutAttributes
@synthesize orginalFrame = _orginalFrame;
+ (instancetype)layoutAttributesForDecorationViewOfKind:(NSString *)decorationViewKind withIndexPath:(NSIndexPath *)indexPath orginalFrmae:(CGRect)orginalFrame{
ZLCollectionViewLayoutAttributes *layoutAttributes = [super layoutAttributesForDecorationViewOfKind:decorationViewKind withIndexPath:indexPath];
[layoutAttributes setValue:[NSValue valueWithCGRect:orginalFrame] forKey:@"orginalFrame"];
layoutAttributes.frame = orginalFrame;
return layoutAttributes;
}
-(CGRect)orginalFrame {
if ([self.representedElementKind isEqualToString:UICollectionElementKindSectionHeader]) {
return _orginalFrame;
} else {
return self.frame;
}
}
@end