TabBar Icons

Discussion in 'iOS Programming' started by amalshah71, Mar 27, 2009.

  1. amalshah71 macrumors member

    Joined:
    Feb 1, 2009
    #1
    Hello,
    I have a app with lot of UIViews...and i controll the views using a common tabbar....depending on views i change the tabbar icons....


    The thing is that when i select a icon on tab bar...the blue background remains as it is when i move to the next view....

    How do i make my icons look the same as in when they were not selected...


    Thanks
    amal
     
  2. amalshah71 thread starter macrumors member

    Joined:
    Feb 1, 2009
    #2
    screen shot is as attached.....
     

    Attached Files:

  3. blackmesa macrumors newbie

    Joined:
    Mar 30, 2009
    #3
    While playing with the tab bar I saw that a mask it automatically applied to the buttons. Try playing with the alpha in the icon you are trying to put as background on the tab bar button.
     
  4. amalshah71 thread starter macrumors member

    Joined:
    Feb 1, 2009
    #4
    I believe that alpha thing comes into picture when trying to display the tab bar icon.....thats not my case....

    i want the blue background to go away when i am done with selecting the item....

    what's the way out...


    amal
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    First, I wanna know how you are managing to get more than one item from the tabBar selected at a time. Normally, they operate similar to radio buttons in that selecting one deselects any others. Care to explain how you defined the tabBar either in IB or the code?
     
  6. amalshah71 thread starter macrumors member

    Joined:
    Feb 1, 2009
    #6
    I included tab bar in my window from IB....and with whatever the current views that are being currently displayed..i do a

    array=[[NSArray alloc] initWithObjects:leftArrow,summary,home,differentViews,nil];
    [tabBar setItems:array];
    [array release];

    amal
     
  7. amalshah71 thread starter macrumors member

    Joined:
    Feb 1, 2009
    #7
    guys....am really stuck at this point....i don't see anything wrong in what i am doing...googled a lot but not fruitful yet.....any alternative to remove those background colors....

    amal
     
  8. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #8
    A tab bar takes an array of UIViewControllers, which I assume is what you are doing. Once you have initialised the tabbar you shouldn't need to change its contents at all, and like others have said the TabBar deals with the blue background not you.
     
  9. amalshah71 thread starter macrumors member

    Joined:
    Feb 1, 2009
    #9
    My app navigates through various views through help of Tab Bar and on display of different views a different set of Tab Bar icons is shown on tab bar. So basically i have to change the contents of tab bar , since different views in my app use the same TabBar.

    As said "TabBar deals with the blue background not you"...so is there anyway to get rid of that blue background once the event w.r.t. tab bar icon is over....

    amal
     
  10. Niiro13 macrumors 68000

    Joined:
    Feb 12, 2008
    Location:
    Illinois
    #10
    I think the TabBar is getting confused, because TabBars are supposed to be used for separate pages (just like tabs in a web browser). If you're using the items as buttons, then you should use a UIToolbar. This way, the controls are actual buttons and not tabs.
     

Share This Page