解决方案 »
- ffmpeg编译enable-asm
- 如何在一个UIView显示一幅图?
- 有没有iphone,itouch在条形码和二维码下的案例
- UITextView 只输入一行
- idp申请中Individual(个人)注册的时候需要填写Company/Organization该如何填写?
- ios微信打不开连接怎么办
- 提交审核版本失败。不知道如何是好
- swift怎么取得UIApplication的对象实例
- 使用个推SDK错误
- uiview 的drawRect 中用Quartz2D 画线锯齿严重,请帮忙看下
- 网络断开后再连接的断点续传是怎么实现的?
- 请教使用过SDWebImage的大神关于图片下载后回调方法的问题
如果添加的别外的一个控制器上可以这样:[self addChildViewController:otherVC];
[self.view addSubview:otherVC.view];如果只是转场,使用presentViewController 而且是从底部弹出
这种方法试过了 没有动画效果并且和push过去的效果是一样的
你在addSubView前设置它的位置在屏幕下方,然后在addSuvView,最后在动画里改变它的位置到屏幕顶部,怎么就没效果?
[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){
}];确实没效果啊
[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){
}];确实没效果啊
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"];
是类似弹出对话框的效果吗? 如果是,可参考http://code4app.com/ios/AMSmoothAlert/539eee31933bf05e5c8b5512
大神们是对的 可以直接对vc.view.frame做动画 但是有一个弊端就是viewWillAppear不能触发,不过问题不大