Сдвиньте UIView с использованием KcatransitionPush

Я пытаюсь сделать UIView, выдвиньте вверх по четверти страницы, чтобы открыть еще один вид под ним (для отображения параметров), а затем сдвиньте обратно, чтобы покрыть эти параметры. Я искал так безжалостно, но не могу найти то, что я ищу. Я не хочу использовать ModalView, как я хочу поддерживать вид сверху на экране. В приведенном ниже коде, у меня есть его сортировка, верхний уровень скользит вверх, но затем полностью исчезает (исчезает).

Любая помощь значительно ценится!

Спасибо.

HomeOptionsViewController *homeOptionsViewController  = [[HomeOptionsViewController  alloc] 
                      initWithNibName:@"HomeOptionsViewController" 
                      bundle:nil];
// get the view that's currently showing
UIView *currentView = self.view;
// get the the underlying UIWindow, or the view containing the current view
UIView *theWindow = [currentView superview];

UIView *newView = homeOptionsViewController.view; 
//newView.frame = CGRectMake(0,300, 320,140);
    newView.frame = CGRectMake(0,-10, 320,140);
// remove the current view and replace with myView1
//---[currentView removeFromSuperview];
[theWindow addSubview:newView];

theWindow.frame = CGRectMake(0,-110,320,200);

newView.frame = theWindow.bounds;
// set up an animation for the transition between the views

CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromTop];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
//[theWindow setFrame:CGRectMake(0,200,320,300)];
[[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
5
задан Doug 31 August 2011 в 15:00
поделиться