Skip to content

Commit

Permalink
增加禁止布局功能
Browse files Browse the repository at this point in the history
  • Loading branch information
郑立宝 committed Jun 18, 2021
1 parent 57be069 commit 2fcd785
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,9 @@
**FlexLib**的所有版本的变更日志都将会在这里记录.

---
## 3.1.0
1.FlexRootView增加禁止布局功能

## 3.0.0
1.增加自定义宏支持
2.支持在xml中使用数学表达式,表达式中支持使用自定义宏
Expand Down
2 changes: 1 addition & 1 deletion FlexLib.podspec
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'FlexLib'
s.version = '3.0.0'
s.version = '3.1.0'
s.summary = 'An obj-c flex layout framework for IOS & mac'

# This description is used to generate tags and improve search results.
Expand Down
6 changes: 6 additions & 0 deletions FlexLib/Classes/FlexRootView.h
Expand Up @@ -77,6 +77,12 @@
*/
@property(nonatomic,assign) BOOL useFrame;

/**
* 如果对子view做动画时,可以临时关闭FlexRootView的布局功能,动画完成时再打开
* 默认为NO
*/
@property(nonatomic,assign) BOOL disableLayout;

/**
* 宽和高是否有内容决定,默认为NO
* 如果为NO,则表示外部必须明确指定宽度或者高度
Expand Down
3 changes: 2 additions & 1 deletion FlexLib/Classes/FlexRootView.m
Expand Up @@ -249,6 +249,7 @@ - (instancetype)init
_lastConfigFrame = CGRectZero;
_bChildDirty = NO;
_useFrame = NO;
_disableLayout = NO;

[self enableFlexLayout:NO];
}
Expand Down Expand Up @@ -467,7 +468,7 @@ -(BOOL)isConfigSame

-(void)layoutSubviews
{
if(_bInLayouting)
if(self.disableLayout || _bInLayouting)
return;

[self configureLayout: [self getSafeArea]];
Expand Down

0 comments on commit 2fcd785

Please sign in to comment.