Objective-C的UIPageViewController和PageControls
问题描述:
我创建UIPageViewController和覆盖这些功能:Objective-C的UIPageViewController和PageControls
- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController
- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController
,并在这里创建的PageControl。
我该如何改变PageContol的风格? (默认是白色的,但我需要暗)
答
在UIPageControl类引用(http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPageControl_Class/Reference/Reference.html),你可以找到两个属性,这将是你的兴趣:pageIndicatorTintColor和currentPageIndicatorTintColor。
用你想要的UIColor改变你的UIPageControl实例的两个属性,例如: [UIColor blackColor]用于深色等。
UIPageViewController符合UIAppearance协议,您可以通过这种方式进行颜色自定义。 –