UIViewController Title attribute in Storyboard

后端 未结 10 2102
南旧
南旧 2021-02-03 19:58

I am setting the title field of a UIViewController via Interface Builder/Storyboard: \"enter

10条回答
  •  时光说笑
    2021-02-03 20:14

    If you have UINavigationItem present, then you must use the navigation item title in the storyboard. If you don't have a navigation item for a view controller, then the UINavigationController will use the view controller's title property.

    Example :

    In your storyboard, if you have a navigation item the navigation controller doesn't need to read the view controller's title. Even if the title field is empty for this navigation item.

    Remove the navigation item (if you can, you won't be able to do it for the root view controller but you will for the others) and your title will be correctly loaded

提交回复
热议问题