The indicators of UIPageControl are white and grey, which is great on dark backgrounds but not so good when you have light or white background. You also can’t change much about its appearance which seemed a bit of a bother.
My immediate reaction at this point was to subclass UIPageControl and override Draw(rect) and draw the indicators how I needed them. I searched, found some drawing code already done, and pasted it in. Imagine my surprise when I found that it wasn’t drawing correctly, the inactive page indicators appeared correct and the active page indicator appeared as a dark ring instead of a solid dot.
I discovered, as others have here that UIPageControl doesn’t draw the indicator dots, it uses sub-views to display the indicators. Overriding Draw isn’t going to help you at all - your drawing will be under the default rendering.
The solution is to implement your own UIPageControl derived from UIControl, which I did and will put into a library I’m calling MonoKit. For now the (partial) replacement of UIPageControl is this
namespaceMonoKit.UI{usingSystem;usingSystem.Drawing;usingMonoTouch.UIKit;/// <summary>/// Implements a replacement for UIPageControl./// </summary>publicclassPageControl:UIControl{privateintpageCount;privateintcurrentPage;privateboolhidesForSinglePage;privateUIColoractivePageColor;privateUIColorinactivePageColor;/// <summary>/// Initializes a new instance of the <see cref="MonoKit.UI.PageControl"/> class./// </summary>publicPageControl(RectangleFframe):base(frame){this.HidesForSinglePage=false;this.BackgroundColor=UIColor.Clear;this.Enabled=false;this.ActivePageColor=UIColor.DarkGray;this.InactivePageColor=UIColor.LightGray;}/// <summary>/// Gets or sets the number of indicators that the page control should display/// </summary>publicintPages{get{returnthis.pageCount;}set{this.pageCount=value;this.SetNeedsDisplay();}}/// <summary>/// Gets or sets the current page number./// </summary>publicintCurrentPage{get{returnthis.currentPage;}set{this.currentPage=value;this.SetNeedsDisplay();}}/// <summary>/// Gets or sets a value indicating whether the indicators should be hidden when there is only 1 page/// </summary>publicboolHidesForSinglePage{get{returnthis.hidesForSinglePage;}set{this.hidesForSinglePage=value;this.SetNeedsDisplay();}}/// <summary>/// Gets or sets the color of the active page indicator/// </summary>publicUIColorActivePageColor{get{returnthis.activePageColor;}set{this.activePageColor=value;this.SetNeedsDisplay();}}/// <summary>/// Gets or sets the color of the inactive page indicators/// </summary>publicUIColorInactivePageColor{get{returnthis.inactivePageColor;}set{this.inactivePageColor=value;this.SetNeedsDisplay();}}/// <summary>/// Draws the page indicators /// </summary>publicoverridevoidDraw(RectangleFrect){if(!this.HidesForSinglePage||this.Pages>1){varcontext=UIGraphics.GetCurrentContext();context.SaveState();context.SetAllowsAntialiasing(true);vardotSize=5;vardotsWidth=(dotSize*this.Pages)+(this.Pages-1)*10;varoffset=(this.Frame.Size.Width-dotsWidth)/2;for(inti=0;i<this.Pages;i++){vardotRect=newRectangleF(offset+(dotSize+10)*i,(this.Frame.Size.Height/2)-(dotSize/2),dotSize,dotSize);if(i==this.CurrentPage){context.SetFillColor(this.ActivePageColor.CGColor);context.FillEllipseInRect(dotRect);}else{context.SetFillColor(this.InactivePageColor.CGColor);context.FillEllipseInRect(dotRect);}}context.RestoreState();}}}}