下面的代码是我一直在设置导航栏外观色调的地方。我将如何添加背景图像?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UINavigationBar appearance] setBarTintColor:
[UIColor colorWithRed:0.158 green:0.457 blue:0.405 alpha:1]];
你可以使用 -setBackgroundImage:forBarMetrics: 方法。这是最简单的方法。例如:
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navBarBackground"] forBarMetrics:UIBarMetricsDefault]