Ios 启动映像和映像资源

Ios 启动映像和映像资源,ios,uiimageview,splash-screen,xcasset,Ios,Uiimageview,Splash Screen,Xcasset,我正在开发一个小应用程序,我的图像有问题 我已经为每个设备定义了一个包含图像的xcassets,称为LaunchImage 它工作正常 接下来的问题是,无论加载应用程序需要多少时间,我都想将该图像保留2秒钟 为此,我在AppDelegate中使用以下代码。在这里,我使用动画再次加载相同的图像2秒钟 splashView= [[UIImageView alloc] initWithFrame:([[UIScreen mainScreen] bounds])]; NSMutableArra

我正在开发一个小应用程序,我的图像有问题

我已经为每个设备定义了一个包含图像的xcassets,称为LaunchImage

它工作正常

接下来的问题是,无论加载应用程序需要多少时间,我都想将该图像保留2秒钟

为此,我在AppDelegate中使用以下代码。在这里,我使用动画再次加载相同的图像2秒钟

splashView= [[UIImageView alloc] initWithFrame:([[UIScreen mainScreen] bounds])];

    NSMutableArray *images = [[NSMutableArray alloc] init];

    [images addObject:[UIImage imageNamed:@"LaunchImage"]];

    [self.window addSubview:splashView];
    [self.window bringSubviewToFront:splashView];
    splashView.animationImages = images;
    splashView.animationDuration = 2;
    splashView.animationRepeatCount = 1;
    [splashView startAnimating];
在iphone 6上测试时,我注意到它显示为从一个图像切换到另一个图像,因为这不是从xcasset LaunchImage恢复相同的图像

启动屏幕正在加载对应于尺寸750x1334的图像,AppDelegate代码正在加载对应于尺寸640x960的图像

知道为什么会这样吗


谢谢

您还有名为LaunchImage的图像文件吗?(
imagename:
查找这些)不,我只有一个名为LaunchImage的xcassets。事实上,我测试了xcassets的更改图像,发现事实上,两个加载都是从LaunchImage xcassets进行的,但第一个加载的是750x1334图像,第二个加载的是640x960图像。您是否还有名为LaunchImage的图像文件?(
imagename:
查找这些)不,我只有一个名为LaunchImage的xcassets。事实上,我测试了xcassets的更改图像,发现实际上,两个加载都是从LaunchImage xcassets进行的,但第一个加载的是750x1334图像,第二个加载的是640x960图像。