本文介绍了从故事板链显示视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在故事板中有一个链,我想在第一次启动应用程序时开始(例如)第二个视图.我有一些代码,仅适用于

I have a chain in storyboard and I want to start (for example) second view when I have first launching app. I have some code, which only work in

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

方法,如果我把它放进去

method, if I put it in

- (void)viewDidLoad

方法不行,

显示我的另一个视图的代码是:

the code which show my other view is:

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"someId"];
[vc setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];

如何在应用程序首次启动时显示在故事板链中的视图?

How can I show view, which have place in chain in storyboard when app have first launching?

推荐答案

-(void)viewDidAppear:(BOOL)animated.

有关 iOS 视图控制器生命周期的更多信息,请访问 UIViewController 类参考

For further information on the iOS viewcontroller lifecycle head over to UIViewController class reference

这篇关于从故事板链显示视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 06:34