标签:make gre win dex etc sel height image ima
创建一个类,继承UIPageControl,重写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 = 10;
size.width = 10;
[subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y,
size.width,size.height)];
}
}
如果只改变当前选中的点的大小,前面加个判断就可以了:
- (void) setCurrentPage:(NSInteger)page {
[super setCurrentPage:page];
for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
if (subviewIndex == page)
{
UIImageView* subview = [self.subviews objectAtIndex:subviewIndex];
CGSize size;
size.height = 10;
size.width = 10;
[subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y,
size.width,size.height)];
}
}
}
标签:make gre win dex etc sel height image ima
原文地址:http://www.cnblogs.com/cui-cui/p/6474522.html