#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)
//调用方法 改变PageControl样式
[self changePageControlImage:self.detailPageControl];
//改变pagecontrol中圆点样式
- (void)changePageControlImage:(UIPageControl *)pageControl{
static UIImage *currentImage = nil;
static UIImage *otherImage = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
currentImage = [UIImage imageNamed:@"dot"];
otherImage = [UIImage imageNamed:@"dotk"];
});
if (iOS7) {
[pageControl setValue:currentImage forKey:@"_currentPageImage"];
[pageControl setValue:otherImage forKey:@"_pageImage"];
} else {
for (int i = ;i < self.thubmImageArray.count; i++) {
UIImageView *imageVieW = [pageControl.subviews objectAtIndex:i];
imageVieW.frame = CGRectMake(imageVieW.frame.origin.x, imageVieW.frame.origin.y, , );
imageVieW.image = pageControl.currentPage == i ? currentImage : otherImage;
}
}
}
dotk@2x.png
dot@2x.png