【发布时间】:2016-01-24 07:02:25
【问题描述】:
我怎样才能为所有页面显示不同的 - 不同的颜色。
- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController {
[self setupPageControlAppearance:currentPageIndex];
return currentPageIndex;
}
- (void)setupPageControlAppearance:(NSInteger)index
{
UIPageControl * pageControl = [[self.view.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"(class = %@)", [UIPageControl class]]] lastObject];
pageControl.pageIndicatorTintColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.2];
pageControl.currentPageIndicatorTintColor = [ColorUtils getCurrentPageColor];
}
由于添加视图时调用的外观,它不会改变当前页面颜色。
注意 - 上面的代码是为了改变我尝试的当前页面颜色。
但是我有什么办法可以做到这一点 -
有什么帮助吗?
【问题讨论】:
标签: ios objective-c uipageviewcontroller uipagecontrol