//タイトル
self.navigationItem.title = "タイトル"
//タイトルの色
self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.blue]
//戻るボタンを隠す
self.navigationItem.setHidesBackButton(true, animated: true)
//左右にボタン追加
let leftButton = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: nil)
let rightButton1 = UIBarButtonItem(barButtonSystemItem: .undo, target: self, action: nil)
let rightButton2 = UIBarButtonItem(barButtonSystemItem: .save, target: self, action: nil)
self.navigationItem.leftBarButtonItem = leftButton
self.navigationItem.rightBarButtonItems = [rightButton1, rightButton2]
//ボタンアイテムの色
self.navigationController?.navigationBar.tintColor = .red
//バーの色
self.navigationController?.navigationBar.barTintColor = .gray
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
01