Пример #1
0
            private void DrawDayLabel(CGRect rect, DateTime date)
            {
                // var r = new RectangleF(new PointF(0, 5), new SizeF {Width = CurrentWidth, Height = 35});
                if (date == DateTime.Today)
                    UIColor.Blue.SetColor ();
                else
                    UIColor.DarkGray.SetColor ();
                CGRect dayRect = rect.SetSize(new CGSize(rect.Width,35));
                dayRect.Height = dayRect.Height / 2;

                var s = new NSString (date.DayOfWeek.ToString ());
                s.DrawString (dayRect, UIFont.BoldSystemFontOfSize (12), UILineBreakMode.WordWrap, UITextAlignment.Center);

                CGRect dateRect = dayRect;
                dateRect.Y += dayRect.Height;
                var s2 = new NSString (date.ToString ("M/d"));
                s2.DrawString (dateRect, UIFont.BoldSystemFontOfSize (12), UILineBreakMode.WordWrap, UITextAlignment.Center);
                UIColor.Black.SetColor ();
            }