ASDK

作者: ONE2 | 来源:发表于2019-01-22 20:46 被阅读11次

ASDK demo
https://github.com/texturegroup/texture/tree/master/examples

Photo with Outset Icon Overlay
To create this layout, we will use a:

ASAbsoluteLayoutSpec to place the photo and icon which have been individually sized and positioned using their ASLayoutable properties

- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
{
  _iconNode.style.preferredSize = CGSizeMake(40, 40);
  _iconNode.style.layoutPosition = CGPointMake(150, 0);
  
  _photoNode.style.preferredSize = CGSizeMake(150, 150);
  _photoNode.style.layoutPosition = CGPointMake(40 / 2.0, 40 / 2.0);
  
  return [ASAbsoluteLayoutSpec absoluteLayoutSpecWithSizing:ASAbsoluteLayoutSpecSizingSizeToFit
                                                   children:@[_photoNode, _iconNode]];
}
image.png
image.png

相关文章

网友评论

      本文标题:ASDK

      本文链接:https://www.haomeiwen.com/subject/nmwrjqtx.html