在我的应用程序中,导航栏下方显示一条细线 . 问题仅出现在使用xcode 10.1版本构建的应用程序中 . 使用xcode早期版本创建构建时,该问题不存在 . 我已经为导航栏创建了一个自定义类,我已经为导航栏分配了一个背景图像 . 下面是代码

[self setBackgroundImage:[UIImage imageNamed:@"Nav-Img"] forBarMetrics:UIBarMetricsDefault];

我试图通过使用下面的代码删除阴影图像来解决问题,但没有修复 .

self.shadowImage = [[UIImage alloc]init];

我也尝试了以下代码 . 但没有结果 .

for parent in self.navigationController!.navigationBar.subviews {
 for childView in parent.subviews {
     if(childView is UIImageView) {
         childView.removeFromSuperview()
     }
 }
}

任何人都知道为什么会出现这个问题? enter image description here