[英]add navigation bar, and tab bar to all pages
My current state of app is like this: Current state of app 我目前的应用程序的状态是这样的: 应用程序的当前状态
Navigation bar and tab bar are both images. 导航栏和标签栏都是图像。 There are buttons on the tab bar.
标签栏上有按钮。 Now I have the same set of buttons and images all across the app.
现在,我在整个应用程序中都具有相同的按钮和图像集。 I am a total noob in iOS.
我在iOS中是个菜鸟。 I wish to use some internal functioning like toolbar/navigation bar/tab bar which is provided by xcode itself, instead of using separate images.
我希望使用一些内部功能,例如xcode本身提供的工具栏/导航栏/选项卡栏,而不是使用单独的图像。 I want tab bar and navigation bars in all my pages.
我要在所有页面中使用标签栏和导航栏。 Is there any way to add these tab bars and navigation bars to all the pages?
有什么办法可以将这些标签栏和导航栏添加到所有页面? I am also using a superclass, to inherit all the common functions.
我还使用超类来继承所有常用功能。
I use swift. 我用迅捷。
You have to embed in your root view controller
with a navigation controller
, and that navigation controller
embed in with a tab bar controller
. 您必须使用
navigation controller
嵌入到根view controller
,并且该navigation controller
与tab bar controller
一起嵌入。
To "embed in" a view controller
, just select your root view controller
on the storyboard
and select Editor
-> Embed in
-> Navigation Controller
. 要“嵌入”
view controller
,只需在storyboard
上选择您的根view controller
,然后选择Editor
-> Embed in
-> Navigation Controller
。
To "embed in" your navigation controller
, just select it on the storyboard
and select Editor
-> Embed in
-> Tab Bar Controller
要“嵌入”
navigation controller
,只需在storyboard
上选择它,然后选择“ Editor
->“ Embed in
->“ Tab Bar Controller
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.