feat:step 11
This commit is contained in:
parent
d8a743f13f
commit
ea8ea4a8ff
@ -274,9 +274,6 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
||||
CGSize childSize;
|
||||
if (CGAffineTransformEqualToTransform(child.transform, CGAffineTransformIdentity)) {
|
||||
childSize = [child measureSize:CGSizeMake(size.width, size.height - contentHeight)];
|
||||
if (childConfig.weight) {
|
||||
childSize.height = child.height;
|
||||
}
|
||||
} else {
|
||||
childSize = child.bounds.size;
|
||||
}
|
||||
@ -320,7 +317,7 @@ - (void)layoutSelf:(CGSize)targetSize {
|
||||
|
||||
CGSize size = [child measureSize:CGSizeMake(targetSize.width, targetSize.height - yStart)];
|
||||
if (childConfig.weight) {
|
||||
size.height = child.height + remain / self.contentWeight * childConfig.weight;
|
||||
size.height += remain / self.contentWeight * childConfig.weight;
|
||||
}
|
||||
[child layoutSelf:size];
|
||||
DoricGravity gravity = childConfig.alignment | self.gravity;
|
||||
@ -365,9 +362,6 @@ - (CGSize)sizeThatFits:(CGSize)size {
|
||||
CGSize childSize;
|
||||
if (CGAffineTransformEqualToTransform(child.transform, CGAffineTransformIdentity)) {
|
||||
childSize = [child measureSize:CGSizeMake(size.width - contentWidth, size.height)];
|
||||
if (childConfig.weight) {
|
||||
childSize.width = child.width;
|
||||
}
|
||||
} else {
|
||||
childSize = child.bounds.size;
|
||||
}
|
||||
@ -413,7 +407,7 @@ - (void)layoutSelf:(CGSize)targetSize {
|
||||
|
||||
CGSize size = [child measureSize:CGSizeMake(targetSize.width - xStart, targetSize.height)];
|
||||
if (childConfig.weight) {
|
||||
size.width = child.width + remain / self.contentWeight * childConfig.weight;
|
||||
size.width += remain / self.contentWeight * childConfig.weight;
|
||||
}
|
||||
|
||||
[child layoutSelf:size];
|
||||
|
@ -128,7 +128,8 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
|
||||
DoricSlideItemNode *node = cell.doricSlideItemNode;
|
||||
node.viewId = model[@"id"];
|
||||
[node blend:props];
|
||||
[node.view setNeedsLayout];
|
||||
CGSize size = [node.view measureSize:CGSizeMake(collectionView.width, collectionView.height)];
|
||||
[node.view layoutSelf:size];
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user