gpt4 book ai didi

c# - 即使在添加 Xamarin.Forms.Labs 包后,CheckBox 在 xamarin 表单中抛出异常

转载 作者:行者123 更新时间:2023-11-30 22:00:27 26 4
gpt4 key购买 nike

我正在尝试在 Xamarin Studio Starter Edition 的 Xamarin.Forms PCL 项目中添加 Checkbox。我引用了此链接 How to create checkbox in xamarin forms添加复选框。然后通过 Nuget 包管理器成功添加了 Xamarin.Forms.Labs 包。我添加了命名空间

xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"

在我的 xaml 页面中。运行项目后,我得到 Could not load file or assembly 'XLabs.Forms' or one of its dependencies。系统找不到指定的文件抛出异常。请任何人告诉我问题。

最佳答案

我遇到了这个问题,这是因为我没有按照此页面上的说明进行操作 https://github.com/XLabs/Xamarin-Forms-Labs/wiki

您需要确保将 AppDelegate 更改为从 XFormsApplicationDelegate 派生,这对我来说解决了问题。

[Register("AppDelegate")]
public partial class AppDelegate : XFormsApplicationDelegate

关于c# - 即使在添加 Xamarin.Forms.Labs 包后,CheckBox 在 xamarin 表单中抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28603152/

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