Skip to content

Commit

Permalink
功能升级,BUG修复。
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsoft committed Nov 12, 2019
1 parent 6c39dd0 commit b1173b2
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions MyLayout/Lib/MyFlexLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ typedef enum : int {

extern const int MyFlex_Auto;

//条目的属性,用于设置和获取。

//条目的属性,用于条目视图的属性设置和获取。
@interface MyFlexItemAttrs:NSObject

@property(nonatomic, assign) NSInteger order;
Expand Down Expand Up @@ -96,22 +97,29 @@ extern const int MyFlex_Auto;
-(MyFlexItem* (^)(CGFloat))margin_left;
-(MyFlexItem* (^)(CGFloat))margin_right;
-(MyFlexItem* (^)(CGFloat))margin;

//是否可见
-(MyFlexItem* (^)(MyVisibility))visibility;

//添加到父视图中
-(__kindof UIView* (^)(UIView*))addTo;

@end


//条目的属性,用于设置和获取。


//布局的属性,用于布局视图的属性设置和获取。
@interface MyFlexAttrs:MyFlexItemAttrs

@property(nonatomic, assign) MyFlexDirection flex_direction;
@property(nonatomic, assign) MyFlexWrap flex_wrap;
@property(nonatomic, assign) MyFlexGravity justify_content;
@property(nonatomic, assign) MyFlexGravity align_items;
@property(nonatomic, assign) MyFlexGravity align_content;
@property(nonatomic, assign) UIEdgeInsets padding;
@property(nonatomic, assign) CGFloat vert_space;
@property(nonatomic, assign) CGFloat horz_space;

@end

Expand All @@ -127,11 +135,6 @@ extern const int MyFlex_Auto;
*/
@interface MyFlex:MyFlexItem<MyFlexAttrsContainer>

@property(nonatomic, assign) UIEdgeInsets padding_val;
@property(nonatomic, assign) CGFloat vert_space_val;
@property(nonatomic, assign) CGFloat horz_space_val;


//方向设置
-(MyFlex* (^)(MyFlexDirection))flex_direction;
//换行设置
Expand All @@ -152,6 +155,11 @@ extern const int MyFlex_Auto;

@end






//条目视图在应用flexbox时的分类扩展,只有MyFlexLayout中的子视图才有用。
@interface UIView(MyFlexLayout)

Expand All @@ -163,7 +171,7 @@ extern const int MyFlex_Auto;

/*
* 弹性布局是为了兼容flexbox语法而建立了一个布局,它是从MyFlowLayout派生。在MyFlowLayout中也是支持类似flexbox的一些特性的
* 但是它的属性和flexbox不兼容和一致,因此提供一个新的类MyFlexLayout来完全支持flexbox.
* 因为它的属性和flexbox不兼容,所以提供一个新的类MyFlexLayout来完全支持flexbox.
*/
@interface MyFlexLayout:MyFlowLayout

Expand Down

0 comments on commit b1173b2

Please sign in to comment.