Ios 白线出现在导航栏上

Ios 白线出现在导航栏上,ios,uinavigationbar,Ios,Uinavigationbar,我试图通过AppDelegate设置导航栏的颜色,并将纯色框设置为背景图像。这是我使用的代码: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animat

我试图通过
AppDelegate
设置导航栏的颜色,并将纯色框设置为背景图像。这是我使用的代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:   (NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];


[[UINavigationBar appearance] setBackgroundImage:
 [UIImage imageNamed:@"Navigation"] forBarMetrics:UIBarMetricsDefault];

NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil];
[[UINavigationBar appearance] setTitleTextAttributes:attributes];

return YES;
}
很奇怪,我在导航栏中间有一条白线。请记住,我在另一个应用程序中使用了完全相同的方法,并且一切正常。这就是它看起来的样子:
检查视图控制器是否位于NavigationController下。我打赌您没有为viewController设置navigationController


顺便说一句,如果要使用白色状态样式,还需要将“基于视图控制器的状态栏外观”更改为“否”。

检查视图控制器是否位于NavigationController下。我打赌您没有为viewController设置navigationController


顺便说一句,如果您想使用白色状态样式,您需要将“基于视图控制器的状态栏外观”也更改为“否”。

Ok最终意识到了问题所在。我忘了添加@2x照片。自从我在iphone5s上运行应用程序以来,它一直在调整一张小照片的大小。

Ok终于意识到了问题所在。我忘了添加@2x照片。自从我在iphone5s上运行应用程序以来,它一直在调整一张小照片的大小