如何使控件ASdisplayNode與單元格高度一致?控制ASdisplayNode高度與單元格高度一致
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize{
NSMutableArray *rightArray =[[NSMutableArray alloc]initWithObjects:_titleNode, _descNode,nil];
[rightArray addObjectsFromArray:_replayNodes];
ASStackLayoutSpec *verStackLayout = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical spacing:8 justifyContent:ASStackLayoutJustifyContentStart alignItems:ASStackLayoutAlignItemsStart children:rightArray];
verStackLayout.style.flexGrow = YES;
verStackLayout.style.flexShrink = YES;
self.dateNode.style.preferredSize = CGSizeMake(130 ,50);//How high is the height of cell?
self.dateNode.style.flexShrink = YES;
ASStackLayoutSpec *horStackLayout = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal spacing:10 justifyContent:ASStackLayoutJustifyContentStart alignItems:ASStackLayoutAlignItemsStart children:@[self.dateNode,verStackLayout]];
horStackLayout.style.flexShrink = YES;
return horStackLayout;
}
看看這個例子:https://github.com/TextureGroup/Texture/tree/master/examples/VerticalWithinHorizontalScrolling – Bimawa
謝謝你,但它不是我的問題。我的線路因ASTableNode單元的高度而異。這不是一個固定的價值。 – freda