我正在用MvvmCross和Xamarin.Forms开发一个小应用程序。
我根据MvvmCross网站上的教程构建了这个项目;问题是,当我尝试添加一个启动屏幕(在android项目上)以在主viewmodel加载时出现时,它会被卡住。。。
[Activity(
Label = "@string/app_name",
Theme = "@style/AppTheme",
MainLauncher = false,
LaunchMode = LaunchMode.SingleTask,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class Start : MvxFormsAppCompatActivity<Setup, App, FormsApp>
{
//LaunchMode = LaunchMode.SingleTask
//MvxFormsAppCompatActivity<MvxFormsAndroidSetup<App, FormsApp>, App, FormsApp>
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
}
}
设置:
public class Setup : MvxFormsAndroidSetup<App, FormsApp>
{
}
飞溅屏幕:
[Activity(
Label = "Template",
MainLauncher = true,
NoHistory = true,
Theme = "@style/AppTheme",
Icon = "@drawable/icon")]
public class SplashScreen : MvxSplashScreenActivity
{
public SplashScreen()
:base(Resource.Layout.SplashScreen)
{
}
protected override void RunAppStart(Bundle bundle)
{
StartActivity(typeof(Start));
base.RunAppStart(bundle);
}
}