29,041
社区成员
发帖
与我相关
我的任务
分享
[self addChildViewController:otherVC];
[self.view addSubview:otherVC.view];
如果只是转场,使用presentViewController 而且是从底部弹出
[/quote]
是类似弹出对话框的效果吗? 如果是,可参考http://code4app.com/ios/AMSmoothAlert/539eee31933bf05e5c8b5512
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"];
