Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 导航项目标题视图在iPhone 8上出现两次_Ios_Swift_Uinavigationbar - Fatal编程技术网

Ios 导航项目标题视图在iPhone 8上出现两次

Ios 导航项目标题视图在iPhone 8上出现两次,ios,swift,uinavigationbar,Ios,Swift,Uinavigationbar,我有一个ViewController,它在viewDidLoad上的navigationItem中添加一个titleView: override func viewDidLoad() { super.viewDidLoad() self.navigationItem.titleView = self.navigationLogo() } /** Navigation Logo */ func navigationLogo() -> UIView { let

我有一个ViewController,它在
viewDidLoad
上的
navigationItem
中添加一个
titleView

override func viewDidLoad() {
    super.viewDidLoad()

    self.navigationItem.titleView = self.navigationLogo()
}

/**
 Navigation Logo
 */
func navigationLogo() -> UIView {
    let logoView = UIView(frame: CGRect(x: 0, y: 0, width: (self.navigationController?.view.frame.width)! * 0.9, height: 44))
    let imageView = UIImageViewAligned(frame: CGRect(x: 5, y: 5, width: logoView.frame.width - 10, height: logoView.frame.height - 10))
    imageView.contentMode = .scaleAspectFit

    switch YTPAppManager.language {
    case .arabic:
        if self.navigationController?.viewControllers.firstIndex(of: self)! == 0 {
            imageView.frame = CGRect(x: -30, y: 5, width: logoView.frame.width - 10, height: logoView.frame.height - 10)
        } else {
            imageView.frame = CGRect(x: -78, y: 5, width: logoView.frame.width - 10, height: logoView.frame.height - 10)
        }
        imageView.image = #imageLiteral(resourceName: "ytp_logo_ar")
        imageView.alignRight = true
    case .english:
        imageView.image = #imageLiteral(resourceName: "ytp_logo")
        imageView.alignLeft = true
    }

    logoView.addSubview(imageView)
    return logoView
}
这在所有手机上都可以正常使用,但自从升级到iOS 13后,现在iPhone 8复制了这幅图像:

这只发生在iPhone8上,所有其他手机看起来都是正确的。我在模拟器和物理设备上都试过,结果在两种类型的设备上都是一致的


你知道为什么iPhone8会复制这个图像吗?

我在不同的设备上也遇到了同样的问题……类似的错误,也许,对吧?