Setting title of UINavigationbar not working

前端 未结 2 1166
孤独总比滥情好
孤独总比滥情好 2021-01-26 01:43

I\'ve looked through a few online tutorials, but nothing is working.

That\'s the code of my viewController:

import UIKit

class ViewController: UINavigat         


        
2条回答
  •  抹茶落季
    2021-01-26 02:36

    Select ViewController from the storyboard.

    Go to the Editor and Embed with Navigation Controller

    1) Select Navigation Item and set title from the storyboard.

    2) By Programmatically

    class ViewController: UIViewController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
            self.title = "Your Title"
        }
    }
    

提交回复
热议问题