【问题标题】:Xamarin Android splash taking too much of timeXamarin Android 启动时间过长
【发布时间】:2018-01-22 21:11:08
【问题描述】:

在我的 xamarin 表单项目中,我的 android 启动画面在打开项目时花费了太多时间。 这是启动画面的代码:

using Android.App;
using Android.OS;

namespace Myproject.Droid
{
    [Activity(Label = "smartWCM", Icon = "@drawable/icon", Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true, ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait)]
    public class SplashActivity : Activity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //System.Threading.Thread.Sleep(5000); //Let's wait a while...
            this.StartActivity(typeof(MainActivity));
        }
    }
}

我尝试评论启动时间,但需要 15 秒才能显示登录页面。我需要在 5 秒内显示登录页面。

有什么解决办法吗?

提前致谢

【问题讨论】:

标签: xamarin.forms splash-screen


【解决方案1】:

有关在 Android 上实现启动画面的更好方法,请参阅https://xamarinhelp.com/creating-splash-screen-xamarin-forms/ 的“更好的方法”部分

【讨论】:

    猜你喜欢
    • 2016-05-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 2019-12-23
    • 2017-04-01
    相关资源
    最近更新 更多