如何将图像作为后退按钮添加到导航栏的左侧。我需要在导航栏中向左箭头。我需要快速解决方案4。
答案 0 :(得分:0)
您可以执行以下操作:
let yourBackImage = UIImage(named: "back_button_image")
self.navigationController?.navigationBar.backIndicatorImage = yourBackImage
self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = yourBackImage
self.navigationController?.navigationBar.backItem?.title = "Custom"
答案 1 :(得分:0)
let backButtonItem = UIBarButtonItem(image: UIImage(named: "left_arrow_icon"), style: .done, target: self, action: #selector(didTapOnBack))
self.navigationItem.leftBarButtonItem = backButtonItem
答案 2 :(得分:0)