0

ビルドされ、正常に動作する iOS アプリがあります。起動画像を追加しましたが、アプリが起動画像から実際のアプリに移行すると、点滅します (スムーズな移行ではありません)。面白いことに、私の起動画面は、表示されている最初のビューと同じビューです。起動イメージを作成した方法は、シミュレーターでアプリを実行し、[ファイル] > [スクリーンショットを保存] に移動してから、それらを xcode にドラッグすることです。

4

2 に答える 2

0

これは私が splahscreen に使用しているものです。このコードを Appdelegate クラスに設定します。それはスムーズに実行されます。

- (void)showSplashView
{
    splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.window.frame.size.width, self.window.frame.size.height)];
    splashView.image = [UIImage imageNamed:@"default.png"];
    [self.window addSubview:splashView];
    [self.window bringSubviewToFront:splashView];

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.window cache:YES];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
    splashView.frame = CGRectMake(-80, -80, self.window.frame.size.width+160.0, self.window.frame.size.height+160.0);
    splashView.alpha = 0.0;
    [UIView commitAnimations];
}

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
{
    [splashView removeFromSuperview];
}

ここで「splashView は単純な UIImageView です」であり、デフォルトの png の代わりに画像名を使用できます。

于 2013-06-26T05:58:48.290 に答える
0

私が使用しているオープンソースクラスでこれを見つけました

//Fade in
[UIView animateWithDuration:0.3 animations:^{
    self.alpha = 1;
}];

それを削除し、すべて正常に動作するようになりました。

于 2013-06-26T02:12:32.937 に答える