自定义iPhone故事板segue无法正常工作

时间:2012-03-16 08:47:37

标签: iphone controller storyboard segue

我想加载另一个视图控制器,所以当新的一个来自底部时,当前滑动,它可以工作,但我没有得到子视图(按钮消失,我只得到空白视图),如何修复它?

目前的代码是:

-(void)perform {
    UIViewController *sourceVC = (UIViewController *) self.sourceViewController;
    UIViewController *destinationVC = (UIViewController *) self.destinationViewController;

    [UIView animateWithDuration:2.0
                     animations:^{ 
                         destinationVC.view.frame=CGRectMake(destinationVC.view.frame.origin.x, 480, destinationVC.view.frame.size.width, destinationVC.view.frame.size.height);
                         sourceVC.view.transform=CGAffineTransformMakeTranslation(0, -480);
                         destinationVC.view.transform=CGAffineTransformMakeTranslation(0, -480);

                     }];

}

1 个答案:

答案 0 :(得分:0)

您可以为viewController创建2个视图,并设置第二个视图origin.y = window.height  然后像这样动画 -

CGRect outFrame = CGRectMake(0, 320, 320, 322);

[UIView animateWithDuration:0.50f 
                      delay:delay
                    options:UIViewAnimationOptionCurveEaseInOut 
                 animations:^{
                     fromView.frame = outFrame;
                     toView.frame = CGRectMake(0, 0, 320, 322);
                 } completion:nil];
像这样......