Search code examples
iphoneiosios4uitabbarcontrolleruitabbar

Hiding a UITabBar programmatically


I have a UITabBar which controls multiple Views and I would like to hide one of them from the release build, but still keeping it in the project as I need it for testing purposes. How can I do this programmatically? It should not be visible to the user at all. Thanks!


Solution

  • Yes you can do this. Try [yourTabBar setHidden:YES]; also [yourTabBar setAlpha:0];

    One other best thing I do, if you are using Interface builder to develop your UI is to move the appropriate UIView (here its UITabBar). out of the main nib (or xib) file. That way you are hiding whatever view you want to hide & at the same time it's part of the build.