2013-02-19 106 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