我知道這是壞的UX,但是客戶端要求每次用戶打開應用程序時顯示啓動畫面2秒。iOS - 每次應用打開時顯示啓動畫面
我試圖通過AppDelegate中通過實施這樣的:
創建初始屏幕的一個實例變量的應用程序中查看控制器 :didFinishLaunchingWithOptions:方法中,和 設置其視圖的α爲0 。
在applicationWillEnterForeground然後:我在 希望閃屏會顯示每個用戶打開 應用時,阿爾法設置爲1,然後設置阿爾法回到0 2秒後。
現在,這個工作,但不正確。當應用程序打開時,主界面會立即顯示,然後顯示啓動畫面。
當然,這不是打算在主UI之前顯示啓動畫面。
我試圖說服客戶端取消這個,但是沒有人知道它是如何正確實施的(以防他們完全堅持要他們)?
從應用中:didFinishLaunchingWithOptions:
_tabBarController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"TabBarController"];
[[self window] setRootViewController:_tabBarController];
[_tabBarController setDelegate:self];
_loadingViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoadingView"];
[[_loadingViewController view] setAlpha:0.0f];
[_loadingViewController willMoveToParentViewController:_tabBarController];
[_tabBarController addChildViewController:_loadingViewController];
[_loadingViewController didMoveToParentViewController:_tabBarController];
[[_tabBarController view] addSubview:_loadingViewController.view];
從applicationWillEnterForeground:
[[_loadingViewController view] setAlpha:1.0f];
[self performSelector:@selector(removeLoadingView) withObject:nil afterDelay:2.0];
那麼你有默認啓動圖像無論如何這是不夠你的客戶? – Popeye 2014-10-03 14:22:47
你的應用程序應該在返回後臺並返回活動狀態之後,返回到之前的狀態嗎? – Popeye 2014-10-03 14:23:19
相信我,我曾嘗試過,但他們堅信,他們希望用戶每次打開應用程序時都能看到啓動畫面。 – Nick 2014-10-03 14:23:45