解决方案 »

  1.   

    [self.view addsubview:otherVC.view];
      

  2.   

    是包含在别外一个控制器上吗?还是只是转场 ? 
    如果添加的别外的一个控制器上可以这样:[self addChildViewController:otherVC];
    [self.view addSubview:otherVC.view];如果只是转场,使用presentViewController 而且是从底部弹出
      

  3.   


    这种方法试过了 没有动画效果并且和push过去的效果是一样的
      

  4.   

    动画我写了的 完全没有用,这个方法得到的其实和push过去是一样的
      

  5.   

    不是从底部往上的动画吗?
    你在addSubView前设置它的位置在屏幕下方,然后在addSuvView,最后在动画里改变它的位置到屏幕顶部,怎么就没效果?
      

  6.   

    qrCodeViewController.view.frame = CGRectMake(0, height, APPWINDOWWIDTH, height);
        [self.view addSubview:qrCodeViewController.view];[UIView animateWithDuration:0.5
                         animations:^{
                             [viewController.view setFrame:CGRectMake(Number_Zero, Number_Zero , ViewController.view.frame.size.width, height)];
                         }
                         completion:^(BOOL finished){
                        }];确实没效果啊
      

  7.   

    ViewController.view.frame = CGRectMake(0, height, APPWINDOWWIDTH, height);
        [self.view addSubview:ViewController.view];[UIView animateWithDuration:0.5
                         animations:^{
                             [viewController.view setFrame:CGRectMake(Number_Zero, Number_Zero , ViewController.view.frame.size.width, height)];
                         }
                         completion:^(BOOL finished){
                        }];确实没效果啊
      

  8.   

    创建View 的 layer层动画使用CABasicAnimation 来创建动画试试。
    UIView *myView= ViewController.view;
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];  // 动画选项的设定  
    animation.duration = 2.5; // 持续时间  
    animation.repeatCount = 1; // 重复次数  
       
    // 起始帧和终了帧的设定  
    animation.fromValue = [NSValue valueWithCGPoint:myView.layer.position]; // 起始帧  
    animation.toValue = [NSValue valueWithCGPoint:CGPointMake(Number_Zero, Number_Zero)]; // 终了帧  
       
    // 添加动画  
    [myView.layer addAnimation:animation forKey:@"move-layer"];  
      

  9.   

    不是转场,是模仿view从一个从一个vc下弹出,现在我需要在不关闭后面vc的情况下,在vc上面弹出另一个vc我会动画- - 大神们不要来给我补动画的课啊
      

  10.   

    不是转场,是模仿view从一个从一个vc下弹出,现在我需要在不关闭后面vc的情况下,在vc上面弹出另一个vc我会动画- - 大神们不要来给我补动画的课啊
    是类似弹出对话框的效果吗? 如果是,可参考http://code4app.com/ios/AMSmoothAlert/539eee31933bf05e5c8b5512
      

  11.   

    直接初始化一个VC,设置VC的view的frame,再addSubview到主VC上不就行了吗
      

  12.   

    哎 耗了很久的时间终于找到问题了 对xcode做了clean(command+shift+k),然后重启了xcode就行了....  xcode最近老是有问题 也不知道为什么 哎...
    大神们是对的 可以直接对vc.view.frame做动画 但是有一个弊端就是viewWillAppear不能触发,不过问题不大