ASDK

2019-01-22  本文已影响11人  ONE2

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
上一篇 下一篇

猜你喜欢

热点阅读