Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.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 10.3.3导航栏未显示所有按钮_Ios_Swift_Uinavigationbar - Fatal编程技术网

iOS 10.3.3导航栏未显示所有按钮

iOS 10.3.3导航栏未显示所有按钮,ios,swift,uinavigationbar,Ios,Swift,Uinavigationbar,我有一个带有3个按钮的UINavigationBar,它在有11个iOS的iPhone7上运行良好,但iPhone5 10.3.3在导航栏中只显示了三个按钮中的右侧 这里怎么了 private func setupNavMenuButtons() { navButtonTimeframe.addTarget(self, action: #selector(timeframeMenuHandler), for: UIControlEvents.touchUpInside)

我有一个带有3个按钮的UINavigationBar,它在有11个iOS的iPhone7上运行良好,但iPhone5 10.3.3在导航栏中只显示了三个按钮中的右侧

这里怎么了

    private func setupNavMenuButtons() {

    navButtonTimeframe.addTarget(self, action: #selector(timeframeMenuHandler), for: UIControlEvents.touchUpInside)
    navButtonTimeframe.setTitle(TIMEFRAMES[InAppProperties.sharedInstance.portfolioTimeframeMode], for: .normal)

    let timeframeBtn = UIBarButtonItem(customView: navButtonTimeframe)

    let refreshNav = UIBarButtonItem(barButtonSystemItem: .refresh, target: self, action: #selector(menuRefreshHandler))

    navButtonConvert.addTarget(self, action: #selector(convertMenuHandler), for: UIControlEvents.touchUpInside)

    var image : UIImage
    switch InAppProperties.sharedInstance.convertSymbolWatch {
    case PreferencesHelper.BTC_SYMBOL:
        image = (UIImage(named: "convert_btc_portfolio")?.withRenderingMode(.alwaysOriginal))!
    case PreferencesHelper.ETH_SYMBOL:
        image = (UIImage(named: "convert_eth_portfolio")?.withRenderingMode(.alwaysOriginal))!
    default:
        image = (UIImage(named: "convert_usd_portfolio")?.withRenderingMode(.alwaysOriginal))!
    }

    navButtonConvert.setImage(image, for: .normal)
    let convertNav = UIBarButtonItem(customView: navButtonConvert)

    self.navigationItem.rightBarButtonItems = [refreshNav, convertNav, timeframeBtn]
}

将该行添加到两个自定义项(除.refresh外):


它正在工作。

尝试通过设置
背景色来调试按钮的框架。
每个屏幕的宽度都不同,在小屏幕中相应地管理按钮。框架没有其他问题
 navButtonTimeframe.frame = CGRect(x: 0.0, y: 0.0, width: 40, height: 40)