iOS,视图之间的转换

时间:2011-10-29 16:18:37

标签: objective-c ios uiviewcontroller transition

在以下代码中

- (IBAction)showAbout:(id)sender {
    AboutView *a = [[AboutView alloc] initWithNibName:@"AboutView" bundle:nil];

    [self setAboutView:a];

    [UIView setAnimationDuration:.75]; 
    [[self aboutView] setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];

    [self presentModalViewController:[self aboutView] animated:YES];
}

这两行看起来一点都不做。

    [UIView setAnimationDuration:.75]; 
    [[self aboutView] setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];

在这个例子中,我使用它们是错误的吗?

2 个答案:

答案 0 :(得分:1)

您无法设置标准过渡的持续时间。

答案 1 :(得分:0)

正如kovpas所说,你不能为苹果开发的过渡设定持续时间。删除代码的uiview部分并将其替换为self.modaltransitionstyle = //您的转换//。此外,如果没有[uiview commitanimations],您指定的任何动画默认都是无用的。