Actually I have written three page controls so far (who knew that I would need all of them). So here they are:
- BAPageControl: features several fixed styles and allows to specify colors for active and inactive dots
- BACustomPageControl: you can specify images for active and inactive dots
- BAGroupedPageControl: when you have too many pages to fit on screen you can show them in groups
And in this post I will talk about this last control—BAGroupedPageControl.
The problem that I faced with one of my apps is that I had too many pages for the page control to show. The first solution was to add "continuous" styles to the BAPageControl and they work very well indeed. The idea is to show individual dots when the number of pages is small enough for dots to fit in screen bounds. But when they don't fit show something like progress indicator so you have a sense where you are in the list of pages. The downside of this approach is that the control changes visually too much, which could be confusing.
My next solution was to introduce grouping so that pages are packed in groups and only one of the groups is visible at any given moment (the group which contains the current page). To indicate that there are more pages available I draw tiny arrows at the sides of the control.
Speaking of API it is the same as in BAPageControl minus "continuous" styles. There is one additional property to specify the number of pages per group.
I also had plans to sell this control on sites which specialize on selling reusable components. For several months it was available at binpress.com but they all gone without a single purchase.
So now this control is a part of the BaseAppKit framework, enjoy!