【问题标题】:Core Animation question about swapping views关于交换视图的核心动画问题
【发布时间】:2010-04-28 17:02:43
【问题描述】:
-(IBAction)buttonPressed1:(id)sender 
{
SignView *tempVC = [[SignView alloc] initWithNibName:@"SignView" bundle:Nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition: UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationDelay:0.0f];
[UIView setAnimationDuration:0.2f];
[self presentModalViewController:tempVC animated:YES];
[tempVC passDataWithString:button1.titleLabel.text andColor:currentlySelectedColor isNightModeOn:nightMode.on];
[UIView commitAnimations];
} 

谁能帮我弄清楚为什么这段代码不起作用?

【问题讨论】:

    标签: iphone-sdk-3.0 uikit uiview interface-builder core-animation


    【解决方案1】:

    这个方法会调用beginAnimations:和commitAnimations,不能嵌套。

    [self presentModalViewController:tempVC animated:YES];
    

    所以将它移到 beginAnimations: 之前或 commitAnimations 之后。

    【讨论】:

    • 好吧,我把它移到了这两个地方,UIView 不像翻页那样卷曲。 SignView 滑动到位,而不是 Curling 到位。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-15
    相关资源
    最近更新 更多