我正在学习使用 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])