View Full Version : disable tab button in tab bar controller

Dec 12, 2008, 02:41 AM
i wana make an application in which a tab bar controller is used with 4 tab buttons. the home page contains a logo of application & a tab bar controller at its bottom.
but by default , the first tab button is selected on tab bar controller. but as my requirement ,the selection of tab buttons of tab bar controller should be disabled on home page.
when i would select a tab button then the view for particular tab button should be opened.
:( My main prob is to disable the first tab button on tab bar controller on home page & insert a navigation controller with view on home page.
so if anyone has idea about this issue then plz do tell me.


Dec 12, 2008, 04:30 AM
Try this;

(assumes your instance of the tab bar is called 'myTabBar' and that the button you want disabled is the first one i.e. index 0)

UITabBarItem *tabBarItem = [[myTabBar items] objectAtIndex:0];
[tabBarItem setEnabled:FALSE];