Skip to content

Commit 0be3f53

Browse files
committed
新增一些功能
1 parent a854ee5 commit 0be3f53

File tree

6 files changed

+15
-2
lines changed

6 files changed

+15
-2
lines changed

Example/FMLayoutKit/FMViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ - (void)viewDidLoad {
116116

117117
{
118118
FMLayoutFixedSection *section = [FMLayoutFixedSection sectionWithSectionInset:UIEdgeInsetsMake(0, 15, 15, 15) itemSpace:10 lineSpace:10 column:2];
119-
119+
section.hidden = YES;
120120
section.header = [FMLayoutHeader elementSize:100 viewClass:[FMCollectionCustomDecoration class]];
121121
section.header.lastMargin = 10;
122122
// section.header.type = FMSupplementaryTypeSuspensionAlways;

FMLayoutKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'FMLayoutKit'
11-
s.version = '1.1.9'
11+
s.version = '1.2.0'
1212
s.summary = 'A short description of FMLayoutKit.'
1313

1414
# This description is used to generate tags and improve search results.

FMLayoutKit/Classes/FMLayout.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ - (void)handleSections{
7272
FMLayoutBaseSection *section = self.sections[i];
7373
section.direction = self.direction;
7474

75+
if (section.isHidden) {
76+
continue;
77+
}
78+
7579
NSIndexPath *sectionIndexPath = [NSIndexPath indexPathForItem:0 inSection:i];
7680
section.indexPath = sectionIndexPath;
7781

FMLayoutKit/Classes/Sections/FMLayoutBaseSection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ NS_ASSUME_NONNULL_BEGIN
9090
@property(nonatomic, assign)FMLayoutLongMoveType moveType;
9191
///某一个item是否可以移动替换
9292
@property(nonatomic, copy)BOOL(^canLongPressExchangeItem)(id section, NSInteger item);
93+
/// 显示隐藏
94+
@property(nonatomic, assign, getter=isHidden)BOOL hidden;
9395
///第一个Item的Y值 横向纵向有区别
9496
@property(nonatomic, assign, readonly)CGFloat firstItemStartY;
9597
///第一个Item的X值 横向纵向有区别

FMLayoutKit/Classes/Sections/FMLayoutBaseSection.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ - (void)prepareBackground{
275275
}
276276

277277
- (NSArray *)showLayoutAttributesInRect:(CGRect)rect{
278+
if (self.isHidden) {
279+
return @[];
280+
}
278281
NSMutableArray *attrs = [NSMutableArray array];
279282
if ([self intersectsRect:rect]) {
280283
if (self.headerAttribute) {

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ multi.dataSource = self;
209209

210210
```
211211
#### 版本更新
212+
2020-08-21(1.2.0)
213+
新增单分组隐藏显示
214+
新增动态计算高度计算之后再更改一次的方法
215+
212216
2020-08-21(1.1.9)
213217
修复小bug,增加section刷新方法
214218

0 commit comments

Comments
 (0)