【问题标题】:Background image to the navigationbar iOS SWIFT导航栏的背景图像 iOS SWIFT
【发布时间】:2018-07-17 05:33:14
【问题描述】:

有人可以帮助我吗?我正在尝试使用

向导航栏添加背景图像
navigationController?.navigationBar.setBackgroundImage(UIImage(named:"navigationBarBackground"), for: .top, barMetrics: .default)

但结果,我的图像像图片上一样错位。感谢您的帮助。

【问题讨论】:

标签: swift image background uinavigationbar navigationbar


【解决方案1】:

self.navigationController.navigationBar.setBackgroundImage(图像, forBarMetrics: .Default)

【讨论】:

    【解决方案2】:

    好吧,我终于找到了答案。错位是由错误的图像尺寸引起的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多