我知道在Swift 2.2中很容易。像这样:
editButtonItem().title = "My Title"
但在Swift 3中,editButtonItem
成为UIViewController
的属性。并且UIBarButtonItem
不再拥有标题。所以这不起作用:
editButtonItem.title = "My Title" // doesn't work
请帮帮我!谢谢!
答案 0 :(得分:0)
这可能对您有帮助!
let navigationBar = navigationController!.navigationBar
navigationBar.tintColor = UIColor.blueColor()
let leftButton = UIBarButtonItem(title: "Left Button", style: UIBarButtonItemStyle.Plain, target: self, action: nil)
navigationItem.leftBarButtonItem = leftButton