在控件本身的属性上是确实不能的。
要自己实现些东西。
网上有人写的例子:
GrayPageControl.h:
#import <Foundation/Foundation.h>
@interface GrayPageControl : UIPageControl
{
UIImage* activeImage;
UIImage* inactiveImage;
}
@end
#import "GrayPageControl.h"
@implementation GrayPageControl
//-(id) initWithCoder:(NSCoder *)aDecoder
//{
// self = [super initWithCoder:aDecoder];
//
// activeImage = [[UIImage imageNamed:@"RedPoint.png"] retain];
// inactiveImage = [[UIImage imageNamed:@"BluePoint.png"] retain];
//
// return self;
//}
-(id) initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
activeImage = [[UIImage imageNamed:@"RedPoint.png"] retain];
inactiveImage = [[UIImage imageNamed:@"BluePoint.png"] retain];
return self;
}
-(void) updateDots
{
for (int i = 0; i < [self.subviews count]; i++)
{
UIImageView* dot = [self.subviews objectAtIndex:i];
if (i == self.currentPage) dot.image = activeImage;
else dot.image = inactiveImage;
}
}
-(void) setCurrentPage:(NSInteger)page
{
[super setCurrentPage:page];
[self updateDots];
}
@end
pageControl = [[GrayPageControl alloc] initWithFrame:CGRectMake(0.0, 460.0 - (96 + 48) / 2, 320.0, 48.0 / 2)];
pageControl.userInteractionEnabled = NO;