xcode iOS 中应用程序顶部的标签栏而不是底部,并自定义?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26474829/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tab Bar on top of App in iOS instead of bottom, and customized?
提问by Jake Weso
Is there a way to customize the tab bar to be a custom design instead of how the iOS default design is, and have it at the top of the app instead of the bottom?
有没有办法将标签栏自定义为自定义设计,而不是 iOS 默认设计,并将其放在应用程序的顶部而不是底部?
Basically I have a custom design for tabs in the app we want to implement and it is on the top, looking similar to below:
基本上,我在我们想要实现的应用程序中对选项卡进行了自定义设计,它位于顶部,类似于下图:
Can I use the Tab Bar controller to achieve this, or do I just have to design it all in a normal view controller and just code everything myself to achieve it?
我可以使用 Tab Bar 控制器来实现这一点,还是我只需要在一个普通的视图控制器中设计它,然后自己编写所有代码来实现它?
回答by AdamPro13
You will have to do it custom. If you're doing this with storyboards I suggest looking for a tutorial on how to implement a vertical tab bar controller (like the one in the Twitter iPad app). There are a few examples out there.
你将不得不做定制。如果您使用情节提要来执行此操作,我建议您查找有关如何实现垂直标签栏控制器(如 Twitter iPad 应用程序中的控制器)的教程。有几个例子。
回答by noobsmcgoobs
You need a custom container vc for the nav, and separate VC for each content area.
您需要一个用于导航的自定义容器 vc,并为每个内容区域使用单独的 VC。
See thisfor more information (Edit- link is dead, read iton Wayback machine).
看 这个有关更多信息(编辑- 链接已失效,请在 Wayback 机器上阅读)。
The main thing you have to do is implement some version of this method provided in the docs as an example
您需要做的主要事情是实现文档中提供的此方法的某个版本作为示例
- (void) cycleFromViewController: (UIViewController*) oldC
toViewController: (UIViewController*) newC