SetPage(Xamarin.Forms.Page)’是过时的错误 – Android

SetPage(Xamarin.Forms.Page)’是过时的错误 – Android,第1张

概述我用Xamarin Forms创建了一个通用的应用程序 我收到了警告 Xamarin.Forms.Platform.Android.FormsApplicationActivity.SetPage(Xamarin.Forms.Page)’已过时 有人遇到过这个吗? 代码如下所示 public class MainActivity : AndroidActivity{ protected 我用Xamarin Forms创建了一个通用的应用程序

我收到了警告

Xamarin.Forms.Platform.Android.FormsApplicationActivity.SetPage(Xamarin.Forms.Page)’已过时

有人遇到过这个吗?

代码如下所示

public class MainActivity : AndroIDActivity{    protected overrIDe voID OnCreate (Bundle bundle)    {        base.OnCreate (bundle);        Xamarin.Forms.Forms.Init (this,bundle);            SetPage (App.GetMainPage ());    }}

保罗

解决方法 Forms 1.3.1支持具有MainPage属性的新Application类,它允许您在单个位置(而不是每个平台一次)设置App start页面.

public class App : Application // superclass new in 1.3{    public App ()    {        // The root page of your application        MainPage = new ContentPage {...}; // property new in 1.3    }

可以使用Migration Guide,其中概述了您需要在应用中为新API进行的所有更改.

总结

以上是内存溢出为你收集整理的SetPage(Xamarin.Forms.Page)’是过时的错误 – Android全部内容,希望文章能够帮你解决SetPage(Xamarin.Forms.Page)’是过时的错误 – Android所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1130107.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存