disable tab button in tab bar controller

Discussion in 'iOS Programming' started by arnieterm, Dec 12, 2008.

  1. macrumors regular

    Joined:
    Aug 28, 2008
    #1
    hi..
    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.

    regards.
     
  2. macrumors member

    neil.b

    Joined:
    Nov 20, 2008
    #2
    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)

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

Share This Page