leftbarbuttonitem does not show up in the navigation bar

前端 未结 7 1811
Happy的楠姐
Happy的楠姐 2021-01-17 10:07

I\'ve been developing an iOS app and have been having issues with using an image as the left bar button item in the navigation bar. I have attempted this in the following wa

7条回答
  •  忘掉有多难
    2021-01-17 10:37

    I had the same problem. To see the button, I had to change the tint color, here's the code in Swift:

    self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(image:UIImage.init(named: "btn_back_default")!, style:UIBarButtonItemStyle.Plain, target: self, action: Selector("back"))
    self.navigationItem.leftBarButtonItem?.tintColor = UIColor.whiteColor()
    

提交回复
热议问题