コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public override ASLayoutSpec LayoutSpecThatFits(ASSizeRange constrainedSize)
 {
     return(BuildNode(constrainedSize.max.Width));
 }