0

I enabled o UITabView on the bottom of the screen, and that works, but the rest of my buttons on the app screen suddenly stopped working. Would anyone know why that might happen? I was using push segueys for them.

I think the issue may be that originally I have a NavigationController that I use on the app, and then the UITabBar controller interferes with it.

Thanks!

GeekedOut
  • 16,905
  • 37
  • 107
  • 185

1 Answers1

1

As per Apple recommendation, UITabBarController should only be the root controller of an app. I think what you are doing is you are having the UITabBarController nested in your UINavigationController, and that won't work.

You can instead select your navigation controller and embed it in a UITabBarController. (I don't have XCode with me now, but I think there's an option in the menu called Embed in -> Tab Bar Controller. You can search for it in Help.)

(If you need the tab bar controller to be nested under nav controller, I believe you need to use some buttons to fake its effect.)

If you only need a tab bar but not tabbar controller, then don't use tabbar controller.

danqing
  • 3,348
  • 2
  • 27
  • 43
  • I didn't do anything explicitly to nest the UITabBarConrtoller in the UINavigationController. I just dragged the UITabBarController to the storyboard, and extended it to the screens I wanted. – GeekedOut Aug 13 '12 at 17:13
  • How did you extend it to the screens? Did you extend it to your `UINavigationController`? – danqing Aug 13 '12 at 17:15
  • once I fully understood your original post, it was easy and it worked - thank you! By any chance, would you know how to just make the tabs text-only, or is it a pain to make them text-only? – GeekedOut Aug 13 '12 at 17:19
  • It's not very easy to do. If you only want the texts to be still at where they are now and hide the icons, you can probably make the tabbar transparent, specify no icons and no select indicators. But if you want customized positioning or appearance, you'd need to subclass the tab bar. for example you can take a look at this: http://stackoverflow.com/questions/3664208/twitter-esque-uitabbarcontroller – danqing Aug 13 '12 at 17:26
  • Edit: You can actually make the tab bar half-transparent: i.e. the top half is transparent, but you can do whatever you like to the buttom half, which is the background of your text. This way you can make it appear to be shorter. This can be done by `UIAppearance` if you are using iOS 5. I don't know if there's any quick way to move the text though. – danqing Aug 13 '12 at 17:29
  • I just rtfm and you can take a look at the `Customizing Appearance` section of http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITabBarItem_Class/Reference/Reference.html. – danqing Aug 13 '12 at 17:32