feat:step7
This commit is contained in:
@@ -94,4 +94,6 @@ typedef NS_ENUM(NSInteger, DoricGravity) {
|
||||
- (CGSize)measureSize:(CGSize)targetSize;
|
||||
|
||||
- (void)doricLayoutSubviews;
|
||||
|
||||
- (BOOL)requestFromSubview:(UIView *)subview;
|
||||
@end
|
@@ -101,20 +101,23 @@ - (void)layoutSelf:(CGSize)targetSize {
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)requestSuperview {
|
||||
return self.layoutConfig
|
||||
&& self.layoutConfig.widthSpec != DoricLayoutExact
|
||||
&& self.layoutConfig.heightSpec != DoricLayoutExact;
|
||||
}
|
||||
|
||||
- (void)doricLayoutSubviews {
|
||||
if ([self requestSuperview]) {
|
||||
if ([self.superview requestFromSubview:self]) {
|
||||
[self.superview doricLayoutSubviews];
|
||||
} else {
|
||||
[self layoutSelf:CGSizeMake(self.width, self.height)];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)requestFromSubview:(UIView *)subview {
|
||||
if (self.layoutConfig
|
||||
&& self.layoutConfig.widthSpec != DoricLayoutExact
|
||||
&& self.layoutConfig.heightSpec != DoricLayoutExact) {
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
@end
|
||||
|
||||
DoricMargin DoricMarginMake(CGFloat left, CGFloat top, CGFloat right, CGFloat bottom) {
|
||||
|
Reference in New Issue
Block a user