2011-07-21 7 views
1

私は私のコードで私は時間間隔のスプラッシュ画面を作成する問題があります。表示を実行すると、ナビゲーションバーが表示されます。今私はそのナビゲーションバーを非表示にしたい。どのように私はそのスプラッシュ画面を削除しますか?スプラッシュ・ビュー・コントローラにおいてスプラッシュ画面からナビゲーションバーを削除するには?

- (void)loadView { 
// Init the view 
//CGRect appFrame = [[UIScreen mainScreen] applicationFrame]; 
CGRect appFrame = CGRectMake(0, 0, 320, 480); 
UIView *view = [[UIView alloc] initWithFrame:appFrame]; 
view.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 
self.view = view; 
[view release]; 

splashImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"LS.jpg"]]; 
splashImageView.frame = CGRectMake(0, 44, 320, 460); 
[self.view addSubview:splashImageView]; 

viewController = [[Menu alloc] init]; 
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:viewController]; 
viewController.view.alpha = 0.0; 
[self.view addSubview:nc.view]; 

timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(fadeScreen) userInfo:nil repeats:NO];} 
-(void) onTimer{ 
NSLog(@"LOAD"); 

}

- (void)fadeScreen{ 
[UIView beginAnimations:nil context:nil]; // begins animation block 
[UIView setAnimationDuration:0.75];  // sets animation duration 
[UIView setAnimationDelegate:self];  // sets delegate for this block 
[UIView setAnimationDidStopSelector:@selector(finishedFading)]; // calls the finishedFading method when the animation is done (or done fading out)  
self.view.alpha = 0.0;  // Fades the alpha channel of this view to "0.0" over the animationDuration of "0.75" seconds 
[UIView commitAnimations]; // commits the animation block. This Block is done. 

}

- (void) finishedFading{ 

[UIView beginAnimations:nil context:nil]; // begins animation block 
[UIView setAnimationDuration:0.75];  // sets animation duration 
self.view.alpha = 1.0; // fades the view to 1.0 alpha over 0.75 seconds 
viewController.view.alpha = 1.0; 
[UIView commitAnimations]; // commits the animation block. This Block is done. 
[splashImageView removeFromSuperview]; 

}

答えて

0

あなたは「デフォルト」のスプラッシュ画面self.navigationController.navigationBar.hidden = YES;

でナビゲーションバーを非表示にすることができます:
のiOSのDefault.png画像機能を使用するにはスプラッシュ画面のための素晴らしい選択肢です。プロジェクトに"Default.png"という名前の画像( 'D'は大文字である必要があります)を追加するだけで、OSは残りの部分を処理します。

+0

上記のコードでは、どのようにdefualt .pngイメージを使用しますか? – ram

+0

あなたはそのView Controllerも必要ありません。私の更新された答えを見てください。 – EmptyStack

+0

"デフォルト"ではなく "Defualt" – Pripyat

0

、のviewDidLoadにこれを追加します。

self.navigationController.navigationBar.hidden = YES; 
0

私はむしろ、スプラッシュビューコントローラビューの代わりにナビゲーションコントローラのビューをウインドウに追加します。また、スプラッシュイメージのフレームを480の高さに変更します。また、@EmptyStackが提案するようにDefault.pngに行くことができます

0

Info.plistでは、「ステータスバーは最初は隠されています」というプロパティをYESに追加できますステータスバーは永遠に消えてしまいました!

関連する問題