Thursday, December 23, 2010

How to create a Animated Menu in iPhone or iPad.

This code is used for Show - Hide a UIView on a particular UIButton Click. Put your content on viewMenu. This code will Show - Hide this UIView with animation.


-(IBAction)btnMenu_TouchUpInside:(id)sender{
    [self.view bringSubviewToFront:viewMenu];
    UIButton* btnSelect = (UIButton*)sender;
    btnSelect.selected = !(btnSelect.selected);
   
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.5];
   
    if(btnSelect.selected)
    {
        [viewMenu setAlpha:1.0];
    }
    else
    {
        [viewMenu setAlpha:0.0];
    }
        [UIView commitAnimations];
}

1 comment:

  1. -------------------
    Thanks for sharing this information i am bookmark this blog. need more post
    -----------------------------------------------------------------
    iPhone 5 App Development And
    iPad Application Developer

    -------------------------------------------------------------------------------

    ReplyDelete