How to add animated splash screen in our application

前端 未结 4 1279
说谎
说谎 2020-12-13 22:39

How to add animated splash screen in our application.

4条回答
  •  执念已碎
    2020-12-13 23:05

    You can use sequence of images, here is code:

    for(NSInteger i=1;i<=totalImages;i++){
            NSString *strImage = [NSString stringWithFormat:@"Activity_%d",i];
            UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:strImage ofType:@"png"]];
            [imageArray addObject:image];
        }
        splashImageView.animationImages = imageArray;
        splashImageView.animationDuration = 0.8;
    

    and just call startAnimation and endAnimation method of UIImageView.

提交回复
热议问题