在运行时查询启动图像 [英] Query launch image at runtime

查看:116
本文介绍了在运行时查询启动图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望通过从初始屏幕(UILaunchImageFile)淡入主屏幕来开启我的应用程序。简单的事情,我想,只是用启动画面作为第一个视图显示UIImageView然后制作过渡动画。

I'd like to have a nice start of my app by fading from the splash screen (UILaunchImageFile) into the main screen. Easy thing, I thought, just show an UIImageView with the splash screen as the very first view and then make a transition animation.

问题是,因为这是一个iPad支持所有四个方向的应用程序,以及所有这些方向的启动屏幕,我需要查询使用了哪个启动画面。我可以查询当前的设备旋转并相应地选择图像,但我想知道是否有更好的方法。

The problem is, since this is an iPad app with all four orientations supported, and splash screens for all these orientations, I would need to query which splash screen was used. I could query the current device rotation and select the image accordingly, but I wonder whether there's a better way.

因此,我可以在某种程度上查询在app期间使用的启动图像开始还是我需要询问设备当前的UI方向并相应地选择文件?

So, can I query somehow which launch image was used during app start or do I need to ask for the device's current UI orientation and chose the file accordingly ?

推荐答案

不,你不能自动执行此操作。查询设备旋转并基于此选择图像是完全正常的。

No, you can't do this automagically. Querying the device rotation and selecting an image based on that is perfectly fine.

在这种情况下你真的只需要肖像或风景,假设你正在正确地旋转视图。

You really only need Portrait or Landscape in this situation though, assuming you are rotating your view properly.

这篇关于在运行时查询启动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆