gpt4 book ai didi

xamarin - 在 Xamarin Forms 应用程序中添加内容之前必须调用 requestFeature()

转载 作者:行者123 更新时间:2023-12-05 07:46:11 26 4
gpt4 key购买 nike

我正在使用 xamarin 表单开发一个示例登录应用程序,我在常见的可移植项目中开发了代码。在Xamarin forms android项目中运行时,报错:

Android.Util.AndroidRuntimeException: requestFeature() must be called before adding content

代码是:

public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

global::Xamarin.Forms.Forms.Init (this, bundle);

LoadApplication (new App());
}
}

enter image description here

我怎样才能克服这个问题?

最佳答案

FormsAppCompatActivity 而不是 FormsApplicationActivity 继承您的 MainActivity

https://github.com/xamarin/Xamarin.Forms/issues/13779

关于xamarin - 在 Xamarin Forms 应用程序中添加内容之前必须调用 requestFeature(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41114416/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com