オプションビューでナビゲーションバーのタイトルを変更することはできません。私はストーリーボードを使用していません。ボタンも追加できません。タイトルナビゲーションを変更できませんコントローラ
これが私のアプリデリゲートコードです:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let viewController = MenuTableViewController(nibName: nil, bundle: nil) //ViewController = Name of your controller
let navigationController = UINavigationController(rootViewController: viewController)
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = navigationController
self.window?.makeKeyAndVisible()
return true
}
これは私のMenuTabeViewControllerが、これは私のオプションは、私は目を信じる
class optionsViewController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
view?.backgroundColor = UIColor.white
//I've tried 3 solutions
self.navigationItem.title = "Options"
self.title = "Options"
self.navigationBar.topItem?.title = "Options"
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
dismiss(animated: true, completion: nil)
}
}
ストーリーボードを使用していますか? –
いいえ、私は言った;) –
ops!申し訳ありません、私の悪い:D –