When UIView height set zero, view's child control not hide

Viewed 2857

I want drawer animation. So I take 1 UIView and add 4 control inside UIView. Now when I click on drawer button, set view height zero when drawer is close and set view height 200 when drawer is open.

But when I set zero height, button is not hide . All buttons are visible. Auto layout is not in my project.

How to solved this problem.?

-(IBAction)Onclick_drawer:(id)sender
{
    if(is_open)
    {
        is_open=false;
        [UIView animateWithDuration:0.3
                              delay:0.0
             usingSpringWithDamping:1.0
              initialSpringVelocity:4.0
                            options: UIViewAnimationOptionCurveEaseInOut
                         animations:^{

                             self.drawer_view.frame=CGRectMake(0, 64, 320,200);
                         }
                         completion:^(BOOL finished){

                         }];
        [UIView commitAnimations];
    }

    else
    {
        is_open=true;
        [UIView animateWithDuration:0.3
                              delay:0.0
             usingSpringWithDamping:1.0
              initialSpringVelocity:4.0
                            options: UIViewAnimationOptionCurveEaseInOut
                         animations:^{
                             self.drawer_view.frame=CGRectMake(0, 64, 320, 0);
                         }
                         completion:^(BOOL finished){

                         }];
        [UIView commitAnimations];
    }


}
3 Answers
Related