diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutItemNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutItemNode.m index 44b08beb..d6c8814e 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutItemNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutItemNode.m @@ -19,16 +19,6 @@ #import "DoricFlowLayoutItemNode.h" -@interface DoricFlowLayoutItemView : UIView -@end - -@implementation DoricFlowLayoutItemView -@end - -@interface DoricFlowLayoutItemNode () -@end - - @implementation DoricFlowLayoutItemNode - (instancetype)initWithContext:(DoricContext *)doricContext { if (self = [super initWithContext:doricContext]) { @@ -41,8 +31,4 @@ - (void)initWithSuperNode:(DoricSuperNode *)superNode { [super initWithSuperNode:superNode]; self.reusable = YES; } - -- (DoricFlowLayoutItemView *)build { - return [DoricFlowLayoutItemView new]; -} @end diff --git a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m index eb17f3f8..f71dfd46 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricFlowLayoutNode.m @@ -182,7 +182,6 @@ - (UICollectionView *)build { it.delegate = self; it.dataSource = self; [it registerClass:[DoricFlowLayoutViewCell class] forCellWithReuseIdentifier:@"doricCell"]; - [it registerClass:[DoricFlowLayoutViewCell class] forCellWithReuseIdentifier:@"doricLoadMoreCell"]; if (@available(iOS 11, *)) { it.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } @@ -318,15 +317,13 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection DoricFlowLayoutItemNode *node = cell.viewNode; node.viewId = model[@"id"]; [node blend:props]; - CGFloat width = (collectionView.width - (self.columnCount - 1) * self.columnSpace) / self.columnCount; -// CGSize size = [node.view measureSize:CGSizeMake(width, collectionView.height)]; -// if (position > 0 && position >= self.itemCount && self.onLoadMoreFuncId) { -// size = CGSizeMake(collectionView.width, size.height); -// [self callJSResponse:self.onLoadMoreFuncId, nil]; -// } -// -// [node.view layoutSelf:size]; -// [self callItem:position size:size]; + node.view.width = (collectionView.width - (self.columnCount - 1) * self.columnSpace) / self.columnCount; + node.view.height = collectionView.height; + if (position > 0 && position >= self.itemCount && self.onLoadMoreFuncId) { + [self callJSResponse:self.onLoadMoreFuncId, nil]; + } + [node.view.doricLayout apply]; + [self callItem:position size:node.view.frame.size]; return cell; }