Esempio n. 1
0
        public static void DrawText(CGContext context, string text, CGPoint position, TextStyle textStyle)
        {
            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            UIGraphics.PushContext(context);

            textStyle.Color.SetColor();

            var textRect = new CGRect(new CGPoint(), text.StringSize(textStyle.Font));

            position = position.Add(textStyle.Offset);

            textRect = textRect.LocateAtPosition(position, textStyle.Position);

            text.DrawString(textRect, textStyle.Font);

            UIGraphics.PopContext();
        }