Tab Bar will no work as a subview of another view but works fine as a subview of window?

倾然丶 夕夏残阳落幕 提交于 2019-12-23 04:26:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!