我的代码是这样的:
[UIVIEw beginAnimations: @"Showinfo"context: nil]; [UIVIEw setAnimationCurve: UIVIEwAnimationCurveEaseInOut]; [UIVIEw setAnimationDuration:0.75]; [self.navigationController pushVIEwController:dtv animated:YES]; [UIVIEw setAnimationTransition:uiviewanimationtransitionFlipFromright forVIEw:self.navigationController.vIEw cache:NO]; [UIVIEw commitAnimations];`
它工作得很好,但是当推送视图并且我返回时,这不会动画.
我回去的时候不知道怎么做同样的动画.
谁能帮我?谢谢!
推送:
[UIVIEw beginAnimations: @"Showinfo"context: nil]; [UIVIEw setAnimationCurve: UIVIEwAnimationCurveEaseInOut]; [UIVIEw setAnimationDuration:0.75]; [self.navigationController pushVIEwController:dtv animated:YES]; [UIVIEw setAnimationTransition:uiviewanimationtransitionFlipFromright forVIEw:self.navigationController.vIEw cache:NO]; [UIVIEw commitAnimations];`
对于Pop:
[
UIVIEw beginAnimations: @"Showinfo"context: nil];[UIVIEw setAnimationCurve:UIVIEwAnimationCurveEaseInOut];[UIVIEw setAnimationDuration:0.75];[UIVIEw setAnimationTransition:uiviewanimationtransitionFlipFromleft forVIEw:self.navigationController.vIEw cache:NO];[UIVIEw commitAnimations];[UIVIEw beginAnimations:nil context:NulL];[UIVIEw setAnimationDelay:0.375];[self.navigationController popVIEwControllerAnimated:NO];[UIVIEw commitAnimations];
我仍然从中获得了很多反馈,因此我将继续更新它以使用动画块,这是Apple建议的动画方式无论如何.
推送:
MainVIEw *nextVIEw = [[MainVIEw alloc] init];[UIVIEw animateWithDuration:0.75 animations:^{ [UIVIEw setAnimationCurve:UIVIEwAnimationCurveEaseInOut]; [super pushVIEwController:nextVIEw animated:NO]; [UIVIEw setAnimationTransition:uiviewanimationtransitionFlipFromright forVIEw:self.navigationController.vIEw cache:NO]; }];
对于Pop:
[UIVIEw animateWithDuration:0.75 animations:^{ [UIVIEw setAnimationCurve:UIVIEwAnimationCurveEaseInOut]; [UIVIEw setAnimationTransition:Transition forVIEw:self.navigationController.vIEw cache:NO]; }];[self.navigationController popVIEwControllerAnimated:NO];总结
以上是内存溢出为你收集整理的ios – 如何设置动画以d出推送的UIViewController全部内容,希望文章能够帮你解决ios – 如何设置动画以d出推送的UIViewController所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)