简体   繁体   中英

How to set tab bar icon and title for a Navigation controller in different Storyboard which has reference in Main.storyboard?

I have two storyboards in which I am using tab bar controller in first storyboard and has storyboard reference of second storyboard with navigation controller as root controller. Currently I'm able to see two tabs but stuck at how to set image and title to second tab, that is referencing to navigation controller in second storyboard.

TabBarController in Main.storyboard Main.storyboard中的TabBarController

Second storyboard 第二个故事板

Select your navigation controller in second storyboard and open attributes inspector. At the top you'll see bottom bar option with inferred selected by default. Change that to translucent tab bar. Now from object library drag and drop "Tab Bar Item" on that translucent tab bar that just appeared. Now you can set the title and icon for that tab.

Set the storyboard reference to Second.storyboard :

在此处输入图片说明

Select Item from storyboard reference and edit the name or image with what you wanted.

在此处输入图片说明

In Second.storyboard , select is initial view controller for UINavigationController :

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM