iOS App Launch Image After a Kill

前端 未结 5 2185
-上瘾入骨i
-上瘾入骨i 2021-02-09 06:16

When I kill my iPhone app and relaunch it I have an image of the app\'s previous state instead of the launch image. How can I force iOS to always show the launch image?

5条回答
  •  生来不讨喜
    2021-02-09 06:43

    Please follow this  -
    -(void)applicationWillResignActive:(UIApplication *)application
    {
        imageView = [[UIImageView alloc]initWithFrame:[self.window frame]];
        [imageView setImage:[UIImage imageNamed:@"Portrait(768x1024).png"]];
        [self.window addSubview:imageView];
    }
    
    Here to remove your imageview:
    - (void)applicationDidBecomeActive:(UIApplication *)application
    {
        if(imageView != nil) {
            [imageView removeFromSuperview];
            imageView = nil;
        }
    }
    It is working and tested many times.
    

提交回复
热议问题