MainLauncher=true 必要并覆盖 RegisterAppStart<T>
MainLauncher=true necessary and overrides RegisterAppStart<T>
使用 MVVMCross,我想在所有平台上以相同的视图启动应用程序。在 App.cs
中使用 RegisterAppStart<FirstViewModel>
似乎是正确的方法。但是在 Android 中有必要用 [Activity(Label = "First Screen", MainLauncher = true)]
定义一个视图。否则 Xamarin Studio 会显示以下错误:No Launchable Activity Found
我做错了什么?
你没有做错任何事。 Android 需要定义 MainLauncher,而 IOS 不需要(总是从 Main() 开始)。不同OS,要求不同。
自己找到了答案:我们需要在 Android 中添加一个简单的 SplashScreen。有关详细信息,请参阅 MVVMCross Docs
使用 MVVMCross,我想在所有平台上以相同的视图启动应用程序。在 App.cs
中使用 RegisterAppStart<FirstViewModel>
似乎是正确的方法。但是在 Android 中有必要用 [Activity(Label = "First Screen", MainLauncher = true)]
定义一个视图。否则 Xamarin Studio 会显示以下错误:No Launchable Activity Found
我做错了什么?
你没有做错任何事。 Android 需要定义 MainLauncher,而 IOS 不需要(总是从 Main() 开始)。不同OS,要求不同。
自己找到了答案:我们需要在 Android 中添加一个简单的 SplashScreen。有关详细信息,请参阅 MVVMCross Docs