2013-02-19 126 views
0

我有一個自定義顏色的簡單UIProgressView,我想失去蘋果的影子,這可以做到嗎?從UIProgressView中刪除陰影?

[[UIProgressView appearance] setProgressTintColor:[UIColor colorWithRed:5/255 green:72/255 blue:255/255 alpha:1.0]]; 
[[UIProgressView appearance] setTrackTintColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.000]]; 

感謝

回答

2

這不是說你想的方式。你將不得不使用一些非常基本的圖像。

你可以看到this後有一個很好的圖片很好的解釋。但基本上你將不得不使用:

[[UIProgressView appearance] setProgressImage:[[UIImage imageNamed:@"ProgressImage"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 1, 0, 1)]]; 
[[UIProgressView appearance] setTrackImage:[[UIImage imageNamed:@"TrackImage"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 1, 0, 1)]]; 

無論您想使用任何彩色圖像。如果你只想要直接的顏色,那麼只需製作一些簡單的單色塊或者用一些漸變來瘋狂。

+0

感謝您的幫助,效果很好。 – 2013-02-20 22:53:50