Loading UINavigationController from another nib automatically by UITabBarController

后端 未结 5 771
無奈伤痛
無奈伤痛 2021-02-06 16:57

I think I\'ve found the cause: Document Info window in IB has a warning: \"\'Selected Navigation Controller (Second)\' has nib name property set to \'SecondView.nib\', but t

5条回答
  •  既然无缘
    2021-02-06 17:29

    Simply swap the UINavigationController with the FirstViewController.

    So the hierarchy should be like this:

    Tab bar controller
    -----Tab bar
    -----Navigation Controller
    ----------First View Controller
    ---------------Navigation Item
    ----------Tab bar item (First)
    -----Navigation Controller
    ----------Second View Controller
    ---------------Navigation Item
    ----------Tab bar item (Second)
    

    You set the nib of First View Controller in the inspector to the nib file containing the actual view objects (Since you are trying to split them into separate files, which is a good thing).

    You have one tab, that tab has a navigation controller which loads First View Controller as its root view.

    Done.

提交回复
热议问题