标签:
#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 = 0;i < self.thubmImageArray.count; i++) { UIImageView *imageVieW = [pageControl.subviews objectAtIndex:i]; imageVieW.frame = CGRectMake(imageVieW.frame.origin.x, imageVieW.frame.origin.y, 20, 20); imageVieW.image = pageControl.currentPage == i ? currentImage : otherImage; } } } dotk@2x.png dot@2x.png
标签:
原文地址:http://www.cnblogs.com/10-19-92/p/5205910.html