Skip to content

Commit 2fcd785

Browse files
author
郑立宝
committed
增加禁止布局功能
1 parent 57be069 commit 2fcd785

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
**FlexLib**的所有版本的变更日志都将会在这里记录.
33

44
---
5+
## 3.1.0
6+
1.FlexRootView增加禁止布局功能
7+
58
## 3.0.0
69
1.增加自定义宏支持
710
2.支持在xml中使用数学表达式,表达式中支持使用自定义宏

FlexLib.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 = 'FlexLib'
11-
s.version = '3.0.0'
11+
s.version = '3.1.0'
1212
s.summary = 'An obj-c flex layout framework for IOS & mac'
1313

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

FlexLib/Classes/FlexRootView.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
*/
7878
@property(nonatomic,assign) BOOL useFrame;
7979

80+
/**
81+
* 如果对子view做动画时,可以临时关闭FlexRootView的布局功能,动画完成时再打开
82+
* 默认为NO
83+
*/
84+
@property(nonatomic,assign) BOOL disableLayout;
85+
8086
/**
8187
* 宽和高是否有内容决定,默认为NO
8288
* 如果为NO,则表示外部必须明确指定宽度或者高度

FlexLib/Classes/FlexRootView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ - (instancetype)init
249249
_lastConfigFrame = CGRectZero;
250250
_bChildDirty = NO;
251251
_useFrame = NO;
252+
_disableLayout = NO;
252253

253254
[self enableFlexLayout:NO];
254255
}
@@ -467,7 +468,7 @@ -(BOOL)isConfigSame
467468

468469
-(void)layoutSubviews
469470
{
470-
if(_bInLayouting)
471+
if(self.disableLayout || _bInLayouting)
471472
return;
472473

473474
[self configureLayout: [self getSafeArea]];

0 commit comments

Comments
 (0)