【发布时间】:2013-07-08 09:58:43
【问题描述】:
当我按下按钮时,我想在 UIViewController 中从 UIView 转换到另一个
我写了这段代码:
- (IBAction)changeView:(id)sender {
CATransition* transition = [CATransition animation];
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
transition.duration = 1.0f;
transition.type = @"cube";
transition.subtype = @"fromTop";
[self.view1.layer removeAllAnimations];
[self.view1.layer addAnimation:transition forKey:kCATransition];
}
此代码会将 view1(UIview) 传输到它自己。我怎样才能让它过渡到另一个 UIView(例如 view2)。我还可以在情节提要中将另一个 UIview (view2) 放在哪里
【问题讨论】:
标签: iphone objective-c xcode transition uivewcontroller