Thursday, 11 August 2011

View sliding-up from bottom on another View in iPhone/iPad

// For iPhone
// set custom view into frame

-(void)viewDidLoad
{
     [super viewDidLoad];
     newView.frame = CGRectMake(0,460,320, 290);
}

- (void)toggleThumbView {   
  
    CGRect frame = [newView frame];
    if (thumbViewShowing) {
       
       
        frame.origin.y += frame.size.height;       
    }
    else {
      
        frame.origin.y -= frame.size.height;
       
    }
   
    //slideUpView.hidden=YES;
   
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.51];
    //[slideUpView setFrame:frame];
   
    [viewName setFrame:frame];      //set here the view name what-ever you want sliding up.
   
    [UIView commitAnimations];
   
    thumbViewShowing = !thumbViewShowing;
   
   
}

Call above method "toggleThumbView " on Button Click

No comments:

Post a Comment