UIImage
*navigationBarImg = [UIImage
imageNamed:@"navigationBar"];
//You must specified the BarMetrics for UINavigationBar, Otherwise it reports an exception.
[[UINavigationBar appearance] setBackgroundImage:navigationBarImg forBarMetrics:UIBarMetricsDefault];
//This is the key to eliminate drop shadow of UINavigationBar
[[UINavigationBar appearance] setShadowImage:[[UIImage alloc]init]];
本文介绍如何使用UIImage为UINavigationBar设置背景图片,并通过设置阴影图片为空来消除导航栏的阴影效果。
1196

被折叠的 条评论
为什么被折叠?



