修改PageControl的小圆点大小

修改PageControl的小圆点大小
http://stackoverflow.com/questions/3409319/is-there-a-way-to-change-page-indicator-dots-color
方法一:重写setCurrentPage方法即可:

  • (void) setCurrentPage:(NSInteger)page {
    [super setCurrentPage:page];
    for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
    UIImageView* subview = [self.subviews objectAtIndex:subviewIndex];
    CGSize size;
    size.height = 12;
    size.width = 12;
    [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y,
    size.width,size.height)];
    if (subviewIndex == page) [subview setImage:[UIImage imageNamed:@"BluePoint.png"]];
    else [subview setImage:[UIImage imageNamed:@"BlackPoint.png"]];
    }
    }

你可能感兴趣的:(修改PageControl的小圆点大小)