0

我想launch screen用 aanimating view所以我必须使用story board or a xib/nib它,因为使用Apple's default launchScreen. 但是当我要这样做时,使用 xib 作为启动屏幕,就会有一个errorlike launch screen may not have connections. 还有其他方法可以将 xib 或故事板用作launchScreen. 任何帮助将不胜感激。

4

4 回答 4

1

您不能创建带有动画的启动屏幕,但您可以创建一个假的启动屏幕视图控制器并在其上添加动画:

是一个示例项目,我在其中用作LaunchScreen.storyboard...启动屏幕,并在其中创建了一个FakeSplashScreenViewControllerin Main.storyboard. 这个视图控制器是我的窗口的根。我把动画放在viewDidLayoutSubviews

[super viewDidLayoutSubviews];
[UIView animateWithDuration:3.f
                 animations:^{
                     self.myView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); // implement your anim here
                 } completion:^(BOOL finished) {
                     // Change the root view controller
                     UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
                     UIApplication *application = [UIApplication sharedApplication];
                     AppDelegate* appDelegate = application.delegate;
                     appDelegate.window.rootViewController = vc;
                 }];
于 2015-09-18T10:33:45.937 回答
0

您可以改用视图控制器并使用它做任何您想做的事情。但您必须首先将主界面从 LaunchScreen.xib 更改为 Main。在此处输入图像描述

于 2015-09-18T11:12:57.677 回答
0

不,不可能用标准工具制作。
您可以创建简单的屏幕、显示动画、加载远程信息和调用 segue。
我选择这种方式。

于 2015-09-18T08:51:40.240 回答
-1

您可以使用以下代码。它可能会帮助你。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
         if(isAnimationShow)
         {
                //do code for show animation in ViewController file.
                ViewController *objlogin = [STORY_BOARD instantiateViewControllerWithIdentifier:@"ViewControllerVC"];
                [self pushViewController:objTimeSheetVC];
         }
         else
         {
               HomeVC *demoViewController = [STORY_BOARD instantiateViewControllerWithIdentifier:@"HomeVC"];
               [self pushViewController:objTimeSheetVC];
         }
}
于 2015-09-18T09:20:18.173 回答