简体   繁体   English

视图之间的UIView动画过渡

[英]UIView animation transition between views

I need to make an animation that will come in from the right, displaying the new view. 我需要制作一个动画,该动画将从右侧显示,以显示新视图。

[UIView beginAnimations:nil context:nil];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationDelay:.5f];
        [UIView setAnimationDuration:0.5f];


// display view controller
[UIView commitAnimations];

What should I add here?? 我应该在这里添加什么?

IF you have navigationController then use 如果您有navigationController然后使用

NextViewcontroller *nextView = [NextViewcontroller alloc]initWithNibName@"NextViewcontroller"
bundle:nil];

[self.navigationController pushViewcontroller:nextView animated:YES];

[nextView release];

How about adding the view as a subView to your current view, then set its place to be outside the current visible area. 如何将视图作为子视图添加到当前视图,然后将其位置设置在当前可见区域之外。 After which you set your animation to change your subViews position to overlap the current view. 之后,您可以设置动画以更改subViews位置以与当前视图重叠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM