Table CellAsyncDisplayKit - ASButton尺寸
我學習使用Asyncdisplaykit。我的結果如下圖所示。 但我不知道如何約束按鈕等於Screen.width/3,它的自動約束條件等於圖像寬度。 這是我的代碼
let controlStack = ASStackLayoutSpec(direction: ASStackLayoutDirection.Horizontal, spacing: 3.0, justifyContent: ASStackLayoutJustifyContent.Center, alignItems: ASStackLayoutAlignItems.Center, children: [self.mFavoriteButton, self.mCommentButton, self.mShareButton])
controlStack.spacingAfter = 3.0
controlStack.spacingBefore = 3.0
let insetDateLayout = ASInsetLayoutSpec(insets: UIEdgeInsets(top: 10, left: self.frame.size.width - 100, bottom: 0, right: 0), child: self.mDateTimeNode)
let imageLayout = ASStaticLayoutSpec(children: [imagePlace, insetDateLayout])
return ASStackLayoutSpec(direction: .Vertical, spacing: 3.0, justifyContent: ASStackLayoutJustifyContent.Start, alignItems: ASStackLayoutAlignItems.Center, children:[imageLayout, self.mMessageNode, controlStack])