2016-09-19 6 views
-1

Swift 2.2では簡単です。このように:Swift 3でeditButtonItemのタイトルを設定する方法

editButtonItem().title = "My Title" 

しかしスウィフト3で、editButtonItemUIViewControllerの財産になります。 UIBarButtonItemにはタイトルがありません。これはうまくいかない:

editButtonItem.title = "My Title" // doesn't work 

私を助けてください!ありがとう!

答えて

0
  1. これは役立ちます!

    let navigationBar = navigationController!.navigationBar 
    navigationBar.tintColor = UIColor.blueColor() 
    
    let leftButton = UIBarButtonItem(title: "Left Button", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
    navigationItem.leftBarButtonItem = leftButton 
    
関連する問題