带有重码的单色触摸屏 [英] Splash screen with heavy codes in monotouch

查看:89
本文介绍了带有重码的单色触摸屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们现在在monotouch和iPhone / ipad应用程序中,当我们想要在应用午餐之前有启动画面时,我们应该在info.plist文件中设置启动图像,它将在应用程序启动之前显示此图像。

We now that in monotouch and for iPhone / ipad application when we want to have splash screen before app lunch we should to set launch image in info.plist file and it will show this image before application launches.

但是当我们想要在后台运行一些重码而不会消失直到这些操作没有完成时,实现启动画面的最佳方法是什么?一些代码,如从互联网上下载应用程序配置和保存在启动画面中经常使用的主题。

But what is the best way to implement a splash screen when we want to have a splash that runs some heavy codes in background and not disappear until these operations had not completed? Some codes like downloading application config from internet and saving theme that often used in splash screen.

推荐答案

BTW,还有另一个解决方案:创建主 UIViewController ,立即在AppDelegate的 FinishedLaunching Window.RootViewController $ c>方法。然后通过以下代码创建并显示模态 splashViewController

BTW, there is another solution: create main UIViewController, set it as Window.RootViewController immediately in AppDelegate's FinishedLaunching method. Then create and show modally splashViewController by this code:

    ...
    MainViewController.PresentModalViewController(splashViewController, true);
    ...

隐藏模态 UIViewController 可以通过调用代码:

Hiding modal UIViewController is possible via calling code:

    DismissModalViewControllerAnimated(true);

请注意,因为iOS 6 PresentModalViewController 已弃用方法。因此,对于许多iOS版本的兼容性,您可以使用特殊方法来显示模态 UIViewController

Note that since iOS 6 PresentModalViewController becomes deprecated method. So, for many iOS versions compatibility you could code special method for showing modal UIViewController.

    public void ShowModalViewController (UIViewController vc, bool animated)
    {
        if (UIDevice.CurrentDevice.CheckSystemVersion(6, 0)) {
            MainViewController.PresentViewController(vc, animated, null);
        } else {
            MainViewController.PresentModalViewController(vc, animated);
        }
    }

这篇关于带有重码的单色触摸屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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