我正在使用Xamarin.Forms和Monodroid项目。
我使用Xamarin.Forms.Labs来呈现ImageButton控件。
每次我尝试在xaml中呈现控件时,我都会得到以下异常:
System.TypeInitializationException:未找到Xamarin.Forms.Labs.Controls.ImageButton -> System.MissingMethodException:方法'BindableProperty.Create‘类型初始化程序引发的异常。
下面是我页面的主要代码:
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="*.MainPage"
xmlns:controls="clr-namespace:Xamarin.Forms.Labs.Controls;assembly=Xamarin.Forms.Labs">
<ContentPage.Content>
<controls:ImageButton HeightRequest="75" WidthRequest="175" ImageHeightRequest="50" ImageWidthRequest="50" />
</ContentPage.Content>我故意删除这些属性,以查看它们是否是此异常的原因。
发布于 2015-06-07 18:27:47
您需要将xamarin.forms.labs升级到xlabs.forms,因为作者完全改变了项目结构。
有关此升级的更多信息可以找到这里。
https://stackoverflow.com/questions/30696124
复制相似问题