upodate flexnode settings
This commit is contained in:
@@ -34,6 +34,7 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
||||
@implementation DoricFlexNode
|
||||
- (UIView *)build {
|
||||
return [[DoricFlexView new] also:^(DoricFlexView *it) {
|
||||
it.clipsToBounds = YES;
|
||||
[it configureLayoutWithBlock:^(YGLayout *_Nonnull layout) {
|
||||
layout.isEnabled = YES;
|
||||
}];
|
||||
|
@@ -38,9 +38,11 @@ - (void)setContentView:(UIView *)contentView {
|
||||
- (CGSize)sizeThatFits:(CGSize)size {
|
||||
if (self.contentView) {
|
||||
if (!self.contentView.doricLayout.resolved) {
|
||||
[self.contentView.doricLayout apply:self.frame.size];
|
||||
[self.contentView.doricLayout apply:size];
|
||||
}
|
||||
return self.contentView.frame.size;
|
||||
return CGSizeMake(
|
||||
MIN(size.width, self.contentView.doricLayout.measuredWidth),
|
||||
MIN(size.height, self.contentView.doricLayout.measuredHeight));
|
||||
}
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
Reference in New Issue
Block a user