UITabBar 求助,请尚未修复!
我有一个 TabBar,其中设置了 2 个 viewController,还有一个 mainScreen 视图。我希望在应用程序启动时显示带有底部 TabBar 的主屏幕视图,并且仅在触摸 TabBar 后才切换到 TabBars viewControllers。
我的问题是,TabBars viewController 的视图只会显示,除非我将 TabBar 的视图设置为clearColor,仅然后显示主屏幕视图。
I have a TabBar with 2 viewControllers set to it, and a mainScreen view. What I want at application launch to display the mainScreen view w/ the TabBar at the bottom, and only switch to TabBars viewControllers once the TabBar is touched.
My problem is that the TabBars viewController's views will only be displayed, unless I set the views of the TabBar to clearColor, only then the mainScreen View is shown.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,您确实应该将 applicationDidFinishLaunching 代码放在这里,以帮助我们了解您的目标。
那么,他们的想法是他们永远无法回到“主屏幕视图”?这有点奇怪,但我想你可以监视 tabBar,当他们按下它时,你会删除主屏幕。所以你的主应用程序委托看起来像这样:
Well, you really should put your applicationDidFinishLaunching code here to help us understand your goal.
So, the idea is they can never get back to the "mainScreen view"? It's a little odd, but I guess you could monitor the tabBar, and when they press it, you remove the mainScreen. So your main app delegate would look something like:
我认为这意味着您的主屏幕视图位于层次结构中的 TabBar 视图下方。您可以将“mainScreen”视图添加为初始 tabBar 视图的子视图。
一旦用户与标签栏交互,您就可以简单地删除主屏幕视图。在您的标签栏委托中:
I think this means your mainScreen view is below your TabBar view in the hierarchy. You could add your "mainScreen" view as a subView of your initial tabBar view.
Once the user interacts with the tab bar you can simply remove your mainScreen view. In your tab bar delegate: