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]];
}
![](https://img.haomeiwen.com/i1206289/ce79ec95b5f322d4.png)
![](https://img.haomeiwen.com/i1206289/5d8cb0b032134687.png)
网友评论