gpt4 book ai didi

xaml - InitializeComponent 不存在

转载 作者:行者123 更新时间:2023-12-01 07:00:20 28 4
gpt4 key购买 nike

InitializeComponent();

此代码行出现在我所有 Xaml 页面的构造函数中的代码后面。
它引发以下错误:

InitializeComponent does not exist.



虽然我已经注释掉了这一行,但现在我无法调试项目中的任何页面。

我怎样才能解决这个问题?

任何帮助将不胜感激。

注意:我使用的是 Xamarin Forms Portable 项目。

更新:当我注释掉这一行并运行页面时,IOS 和 Android 中只显示一个空屏幕,尽管我的页面之前工作正常且没有错误。

更新 2:现在 InitializeComponent 行消失了,但我调试的页面仍然完全空白。

我在 here 上问了一个关于这个新问题的问题.

最佳答案

我在 Xamarin Forms Application 中也遇到了同样的问题。我通过将 Build Action 更改为:

Embedded resource



对于 .xaml 和 .cs 文件都使用属性窗口。

enter image description here

希望它可以帮助你。

关于xaml - InitializeComponent 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39273766/

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