I am trying to open a UIView a quarter of a page to open another view below it (to display the options), and then go down to cover these options. I searched SO ruthlessly but cannot find what I am looking for. I do not want to use modalview, because I want to keep the top view on the screen. In the code below, I have the kind of work, the top level of the slides, but then completely disappears (disappears).
Any help is much appreciated!
Thank.
HomeOptionsViewController *homeOptionsViewController = [[HomeOptionsViewController alloc]
initWithNibName:@"HomeOptionsViewController"
bundle:nil];
UIView *currentView = self.view;
UIView *theWindow = [currentView superview];
UIView *newView = homeOptionsViewController.view;
newView.frame = CGRectMake(0,-10, 320,140);
[theWindow addSubview:newView];
theWindow.frame = CGRectMake(0,-110,320,200);
newView.frame = theWindow.bounds;
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromTop];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
source
share