简体   繁体   中英

how to show second tab in Tab bar controller from another view controller

I'm new to iOS and struggling with tab bar controllers in storyboard

In my app i have a dashboard in that dashboard when i click on button

" Students " it shows a TableView with list of students in tab tar controller

for that i took a tab bar controller with two tabs ,First tab is Students List

from dashboard if i click on Button " Parents " I want to go to Parents list which

is Second tab of a tab bar controller

How to go to Second tab of a tab bar controller directly when i click on Parents

Edit

thnx for ur response i'm now getting second tab directly
but the problem is i'm not getting navigation bar in top if i goto one tab next tab is not getting navigation bar

Just put in your button action method:

[self.tabBarController setSelectedIndex:/*yourIndex*/];

First tab has index 0. So your "Parents" tab has index 1.

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