代码之家  ›  专栏  ›  技术社区  ›  RickiG

使用UIViewAnimationTransition(Cocoa Touch)时是否需要预加载

  •  2
  • RickiG  · 技术社区  · 15 年前

    我使用一些转换(翻转)切换到我的iPhone应用程序中的“设置/关于”视图。 我开始这样的转变:

        SettingsAboutViewController *settingsView = [[SettingsAboutViewController alloc] init];
    
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
                           forView:[self.navigationController view ]
                            cache:YES];
    
    [self.navigationController.view addSubview:settingsView.view];
    [UIView commitAnimations];  
    

    在我的设置AboutViewController的viewDidLoad方法中,我使用设置帧:CGRectMake(x,y,w,h),不涉及笔尖。

    在我调用动画之前,视图似乎不是全部构建的。我以前从来没有遇到过这样的问题,这个特殊的视图在任何其他方面都不繁重和苛刻?

    我需要考虑什么?

    谢谢。

    1 回复  |  直到 15 年前
        1
  •  0
  •   Wasim    13 年前

    用这个怎么样 presentModalViewController ?? 它简单易用。。

    SettingsAboutViewController *settingsView = [[SettingsAboutViewController alloc] initWithNibName:@"SettingsAboutViewController " bundle:nil];

    settingsView.delegate = self;

    //神奇的陈述。这将从右向左翻转。//当您解除ModalViewController时,显示模态视图控制器。

    settingsView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

    [self presentModalViewController:settingsView animated:YES];

    [settingsView release];

    我想那会解决你的问题。

    祝你好运。。!