0

我想制作一个带有阴影的自定义 UINavigationBar。这样做:

UIImage *barImage = [[UIImage imageNamed:@"navbar2.png"]resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; // OK
[[UINavigationBar appearance] setBackgroundImage:barImage forBarMetrics:UIBarMetricsDefault];  // OK

[[UINavigationBar appearance] setShadowColor:[UIColor blackColor]]; // Error

怎么了?

我可以用“外观”做这件事吗?

谢谢!

4

1 回答 1

0

UINavigationBar没有阴影颜色。它有一个阴影图像,或者如果您想设置文本阴影,请使用titleTextAttributes.

于 2012-11-22T18:33:26.430 回答