在ios 5模拟器中使用时,如何更改UIPageControl的颜色

vin*_*nay 7 objective-c uipagecontrol ios5 xcode4.5

我在我的应用程序中使用以下代码: -

在.h文件中

@property (strong, nonatomic) IBOutlet UIPageControl *pageControl;
Run Code Online (Sandbox Code Playgroud)

并在.m文件中

pageControl.currentPage = counting;
Run Code Online (Sandbox Code Playgroud)

数数是NSInteger.该应用程序工作正常,但UIPageControl设置为默认的白色,我无法通过属性检查器更改颜色任何人可以帮助?...

Ben*_*ler 29

在ios 6中,您可以这样做:

pageControl.pageIndicatorTintColor = [UIColor blueColor];
pageControl.currentPageIndicatorTintColor = [UIColor greenColor];
Run Code Online (Sandbox Code Playgroud)