问题
I am trying to make a program with three subviews after the title screen. Two of the views are just standard nib files with UIViewController subclassed to control them, and the third is a Tab Bar view. I can't seem to get the tab bar items to display though. I walked through the Tab bar chapter in "Beginning iPhone Development" which adds the Tab Bar Controller right off the bat as a subview of Window in the app delegate and that works fine. What I want to do though is load up my rootView controller after the third section was chosen from the title screen and then add a Tab Bar view to that. Every time I do this though I get a blank Tab Bar with no tab bar items.
Any help you can provide would be greatly appreciated seeing as I've been working at this for a few days now.
Thanks
回答1:
You can't push a tab bar controller to a navigation controller, which I assume is what you're trying to do. However, you can use a plain UITabBar
and implement your own view switching in a UIViewController
subclass (rather than a UITabBarController
). See this related question.
来源:https://stackoverflow.com/questions/1251981/tab-bar-will-no-work-as-a-subview-of-another-view-but-works-fine-as-a-subview-of