Я использовал этот код:
Источник: http://apptech.next -munich.com / 2010/04 / customizing-uipagecontrols-look.html
// header
@interface StyledPageControl : UIPageControl { }
@end
// implementation
@implementation StyledPageControl
- (void) setCurrentPage:(NSInteger)page {
[super setCurrentPage:page];
NSString* imgActive = [[NSBundle mainBundle] pathForResource:IMG_PAGE_ACTIVE ofType:nil];
NSString* imgInactive = [[NSBundle mainBundle] pathForResource:IMG_PAGE_INACTIVE ofType:nil];
for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
UIImageView* subview = [self.subviews objectAtIndex:subviewIndex];
if (subviewIndex == page) [subview setImage:[UIImage imageWithContentsOfFile:imgActive]];
else [subview setImage:[UIImage imageWithContentsOfFile:imgInactive]];
}
}
- (void) setNumberOfPages:(NSInteger)pages {
[super setNumberOfPages:pages];
NSString* img = [[NSBundle mainBundle] pathForResource:IMG_PAGE_INACTIVE ofType:nil];
for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
UIImageView* subview = [self.subviews objectAtIndex:subviewIndex];
[subview setImage:[UIImage imageWithContentsOfFile:img]];
}
}
@end