public override ASLayoutSpec LayoutSpecThatFits(ASSizeRange constrainedSize) { var layoutWithInsets = ASInsetLayoutSpec.InsetLayoutSpecWithInsets( new UIEdgeInsets(20, 0, 20, 0), _infoTextNode); return(new ASRelativeLayoutSpec(ASRelativeLayoutSpecPosition.Center, ASRelativeLayoutSpecPosition.Center, ASRelativeLayoutSpecSizingOption.Default, layoutWithInsets)); }
public override ASLayoutSpec LayoutSpecThatFits(ASSizeRange constrainedSize) { var messageLayout = ASInsetLayoutSpec.InsetLayoutSpecWithInsets( new UIEdgeInsets(10, 10, 10, 10), _messageNode); var backgroundNode = new ASDisplayNode { BackgroundColor = StyleHelper.Style.AccentColor, CornerRoundingType = ASCornerRoundingType.DefaultSlowCALayer, CornerRadius = 16 }; var messageLayoutWithBackground = ASBackgroundLayoutSpec.BackgroundLayoutSpecWithChild( messageLayout, backgroundNode); var mainLayout = ASCenterLayoutSpec.CenterLayoutSpecWithCenteringOptions( ASCenterLayoutSpecCenteringOptions.Xy, ASCenterLayoutSpecSizingOptions.MinimumXY, messageLayoutWithBackground); return(ASInsetLayoutSpec.InsetLayoutSpecWithInsets( new UIEdgeInsets(8, 20, 8, 20), mainLayout)); }
public override ASLayoutSpec LayoutSpecThatFits(ASSizeRange constrainedSize) { return(BuildNode(constrainedSize.max.Width)); }