<分区>
我想在 navaigationBar
中添加左栏按钮项。
我在左侧有后退按钮标志(没有任何文字),当我添加 leftBarButtonItem
时,我看不到后退按钮。
我该如何解决这个问题。
这是我的代码:
let phonePhoto = UIButton()
phonePhoto.setImage(UIImage(named: "navigationPhone"), for: UIControlState())
phonePhoto.frame = CGRect(x: 0, y: 0, width: 40, height: 40)
phonePhoto.addTarget(self, action: #selector(userEdit), for: .touchUpInside)
let userPhone = UIBarButtonItem()
userPhone.customView = phonePhoto
self.navigationItem.leftBarButtonItem = userPhone