gpt4 book ai didi

objective-c - 转换从 View :toView:duration:options:completion: is not animating the transition

转载 作者:太空狗 更新时间:2023-10-30 03:34:36 26 4
gpt4 key购买 nike

我有一个 View Controller ,它在其 View 的给定区域中显示 2 个 subview Controller 的 View 。 2 个 subview Controller 是 FlopVC 和 FipVC。

我想制作从一个 subview 到另一个 subview 的过渡动画。我使用的代码是:

-(IBAction)flip:(id)sender{

UIViewController *newVC = nil;

if (self.isFlip) {
newVC = [[FlopVC alloc] initWithNibName:nil bundle:nil];
}else{
newVC = [[FipVC alloc] initWithNibName:nil bundle:nil];
}

newVC.view.frame = CGRectMake(120, 20, 240, 260);
[self.view addSubview:newVC.view];

[UIView transitionFromView:self.currentVC.view
toView:newVC.view
duration:0.9
options:UIViewAnimationTransitionFlipFromLeft
completion:^(BOOL finished) {
self.currentVC = newVC;
self.isFlip = ! self.isFlip;
}];



}

subview 被交换,但没有任何动画。我做错了什么?

PS 完整项目是 here .

最佳答案

UIViewAnimationTransitionFlipFromLeft != UIViewAnimationOptionTransitionFlipFromLeft

关于objective-c - 转换从 View :toView:duration:options:completion: is not animating the transition,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7935651/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com