4

UIPageControl の pageIndicatorTintColor で色を設定しても iOS7 で機能しない理由は誰にもわかりますか? このプロパティを設定するコード行は次のとおりです(selfはUIPageControlです):

[self setPageIndicatorTintColor:[UIColor greenColor]];

iOS Developer Library を確認したところ、このプロパティの説明は数週間前と同じようです。Appleの欠陥でしょうか?それを修正する方法はありますか?ただし、iOS6 でも問題なく動作します。

4

2 に答える 2

14

同じ問題があり、メソッドの順序を変更することでこれを修正しました。まず numberOfPages を設定する必要があります。

前:

UIPageControl *pageControl = [[UIPageControl alloc] initWithFrame: ...
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
pageControl.pageIndicatorTintColor = [UIColor grayColor];
pageControl.numberOfPages = 5;

今:

UIPageControl *pageControl = [[UIPageControl alloc] initWithFrame: ...
pageControl.numberOfPages = 5;
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
pageControl.pageIndicatorTintColor = [UIColor grayColor];
于 2013-10-23T09:21:53.073 に答える