Animating a UIToolBar

Discussion in 'iOS Programming' started by roeik, Jan 8, 2010.

  1. roeik macrumors member

    Joined:
    Dec 25, 2008
    #1
    HI Guys,

    I have a view with a UIToolBar at the bottom. I don't have enough space to put all the components that I want on it, so I want to create a button that when you press on it the toolbar moves up and displays another toolbar under it.

    I set up the toolbars on top of each other in interface builder but can anyone help me how I can go about making the top toolbar animating a few pixels up?

    This is kind of similar to advertisements pop up.

    Thanks,

    Roei
     
  2. rarindeed macrumors newbie

    Joined:
    Dec 28, 2009
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    I would suggest following the Apple recommended approach here and have the last tab be More and it brings up a tableView with further choices.
     
  4. roeik thread starter macrumors member

    Joined:
    Dec 25, 2008
    #4
    I don't mean a tab bar, I mean a tool bar. Like in the mail application.
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Ah, my apologies. Musta misread that. Anyways, what would you think about having one of the toolbar choices pop up a list of buttons, similar to Mail's reply action? That also seems more common. But if you're determined to have an extra toolbar appear then, yeah, look into rarindeed's advice and check out the UIView animation methods.
     
  6. roeik thread starter macrumors member

    Joined:
    Dec 25, 2008
    #6
    Thanks. It works.

    For other people, here is the code I used:

    Code:
    [UIView beginAnimations:nil context: @"statToolBar"]; // Tell UIView we’re 
    		[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut ];
    		[UIView setAnimationDuration: 0.4f];
    
    //Set up the new position of the frame of the view
    
    [UIView commitAnimations];
    
     

Share This Page