2013-09-25 48 views
4

任何人都有想法,爲什麼UIPageControl中的pageIndicatorTintColor設置顏色在iOS7中不起作用?下面是代碼,我設置該屬性的行(自我是UIPageControl):UIPageControl中的pageIndicatorTintColor在iOS7中保持半透明白色

[self setPageIndicatorTintColor:[UIColor greenColor]]; 

我在iOS開發庫檢查,這個屬性的描述似乎是一樣的幾個星期前。它可能是蘋果的缺陷嗎?任何想法如何解決它?但在iOS6上仍然正常工作。

+0

請檢查this尋求解決方案。 – Neenu

+0

感謝你,我發現DDPageControl工作得很好。不幸的是,我沒有時間思考Apple在UIPageControl中改變了什麼。代替這個,我實現了DDPageControl。請將您的帖子設置爲完整答案,我會接受它。 – Neru

回答

14

有同樣的問題,通過改變方法的順序固定這一點,首先你需要設置numberOfPages只有經過tintColor的:

前:

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]; 
0

這是非常愚蠢的:在我的情況下,該UIPageControl的alpha爲0.54而不是1。

相關問題