2

enter image description hereI have a UITabBarController with 4 tabs, suppose A,B,C and D. I have a table view in page A. On clicking on any of the rows, E page opens. The problem is that on creating show segue from view controller A to E, the tab bar appears below in E in storyboard, whereas during runtime no tab bar is visible on E. Please could anyone help me out in this.

EDIT :

I can add tab bar item to tab bar of subview as below:

enter image description here

This is the view hierarchy : enter image description here

Note : I want to the tab bar of the main A-D tabs in all sub pages of A-D

shim
  • 9,289
  • 12
  • 69
  • 108
Mamta
  • 921
  • 1
  • 10
  • 28
  • Are you sure it's **Show** segue and not **Present Modally**? Also, are your tableviewcontrollers embedded in a UINavigationController? – netdigger Dec 29 '16 at 09:34
  • @netigger Yes its show segue and its embedded in UINavigationController. Back button is coming properly on page E too. – Mamta Dec 29 '16 at 09:43
  • Sorry to misunderstand your question. If you already embedded the table view controller inside UINavigationController, it should be no problem to push (by using *Show* segue) E to it and the tab bar should be visible unless you uncheck the "Hide Bottom Bar on Push" in your navigation controller. – bubuxu Dec 29 '16 at 10:11
  • Maybe you can debug view hierarchy? And show how that looks? – netdigger Dec 29 '16 at 10:16
  • Can you show your storyboard? – Amanpreet Dec 29 '16 at 10:43
  • @bubuxu "Hide Bottom Bar on Push" is unchecked – Mamta Dec 29 '16 at 11:00
  • @netigger how do I debug view hierarchy? – Mamta Dec 29 '16 at 11:00
  • @Amanpreet I have added the storyboard – Mamta Dec 29 '16 at 11:04
  • I think its not a tab. Its a bottom bar of navigation controller. Just try to to hide it the bottom bar of navigation controller. Because as per my opinion tab bar's usual behavior is that it will show only sub pages of it not in views that are not part of it(i.e View E is not part of tab bar). – Amanpreet Dec 29 '16 at 11:10
  • @Amanpreet Bottom bar of navigation controller is set to none – Mamta Dec 29 '16 at 11:12
  • Can you set a tab bar item on this bottom bar? – Amanpreet Dec 29 '16 at 11:16
  • @Dia debug view hierarhcy like this: http://stackoverflow.com/a/26052806/897465 – netdigger Dec 29 '16 at 11:18
  • @Amanpreet yes i am able to set tab bar item – Mamta Dec 29 '16 at 11:31
  • @netigger it doesn't show tab bar in debug view hierarchy – Mamta Dec 29 '16 at 11:34
  • I want to see. If you don't mind can you update the image. And One more thing is that default behavior that you can see tab in E view because its not usual thing. – Amanpreet Dec 29 '16 at 11:36
  • @Amanpreet I have taken a new view controller as E and set its tab bar item to favourites. I have updated image in my question – Mamta Dec 29 '16 at 11:43
  • Strange thing!! Please check the bottom bar is "none" ? Or its property changed for this view controller? – Amanpreet Dec 29 '16 at 11:50

1 Answers1

2

I want to show you two images in different conditions. Maybe it's not a answer but will help you in some manner.

!) I have tab bar controller connected with navigation controller. That Tab bar has two items. "Top Rated" view has a button that connected to other view controller. Check right hand side attribute section for this bottom bar is none.

enter image description here

2)Same condition for second image but this time I changed the bottom bar option of this view controller(check attribute section). Now the view controller has tab bar item.

enter image description here

But this will not show in run time because this is not connected with tab bar controller. One more thing you can easily put tab bar item on new view controller that are not connected with navigation and tab bar controller, but when you run it will not there.

Updated:

This will help you. Try to set navigation inside of tab bar controller. Give tab bar item to navigation controller. Like:

enter image description here

Output is:

enter image description here

When button clicked:

enter image description here

In that manner you can tab bar in all views.

Update 2:

Here I have Navigation then Home view then the above process with tab bar controller and its working fine.

enter image description here

Updated Output:

enter image description here

When button clicked:

enter image description here

shim
  • 9,289
  • 12
  • 69
  • 108
Amanpreet
  • 1,301
  • 3
  • 12
  • 29