UIPageControl *pageControl = [[UIPageControl alloc] init];
[pageControl setValue:[UIImage imageNamed:@"image1"] forKeyPath:@"_pageImage"];
[pageControl setValue:[UIImage imageNamed:@"image2"] forKeyPath:@"_currentPageImage"];
[self addSubview:pageControl];
self.pageControl = pageControl;
网友评论
[super setCurrentPage:page];
for (NSUInteger i =0; i < [self.subviews count]; i++) {
UIView* dot = [self.subviews objectAtIndex:i];
[dot setFrame:CGRectMake(dot.frame.origin.x, dot.frame.origin.y,18, 18)];
if ([dot.subviews count] == 0) {
UIImageView * view = [[UIImageView alloc]initWithFrame:dot.bounds];
[dot addSubview:view];
};
UIImageView *imageView = dot.subviews[0];
if (i == page) {
imageView.image = [UIImage imageNamed:@"icon_point_sel"];
} else {
imageView.image = [UIImage imageNamed:@"icon_point_nor"];
}
dot.backgroundColor = [UIColor clearColor];
}
}