Esempio n. 1
0
        public override void Draw(CGRect bounds, CoreGraphics.CGContext context, UIView view)
        {
            view.BackgroundColor = UIColor.White;
            CaptionColor.SetColor();
            var width      = bounds.Width - PaddingX * 2;
            var textHeight = Caption.MonoStringHeight(CaptionFont, width);

            Caption.DrawString(new CGRect(PaddingX, PaddingY, width, bounds.Height - PaddingY * 2), CaptionFont, UILineBreakMode.WordWrap);

            if (Value != null)
            {
                ValueColor.SetColor();
                var valueOrigin = new CGPoint(PaddingX, PaddingY + textHeight + 8f);
                var valueSize   = new CGSize(width, bounds.Height - valueOrigin.Y);
                Value.DrawString(new CGRect(valueOrigin, valueSize), ValueFont, UILineBreakMode.WordWrap);
            }
        }