我已经尽我所能搞乱了,但是我找不到在xamarin.forms xaml中嵌入本地xamarin.android CardView控件的方法。以下是我的代码:
我的命名空间
xmlns:androidWidget="clr-namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android"
xmlns:androidWidgetv7="clr-namespace:Android.Support.V7.Widget;assembly=Xamarin.Android.Support.v7.CardView;targetPlatform=Android"
xmlns:androidLocal="clr-namespace:MyApp.Droid;assembly=MyApp.Android;targetPlatform=Android"
我的Xaml
<androidWidgetv7:CardView x:Arguments="{x:Static androidLocal:MainActivity.Instance}" View.HorizontalOptions="Center" View.WidthRequest="600" View.HeightRequest="300">
<androidWidget:TextView x:Arguments="{x:Static androidLocal:MainActivity.Instance}" Text="Simple Native Color Picker" TextSize="24" View.HorizontalOptions="Center"/>
</androidWidgetv7:CardView>
我得到以下错误
Exception is: XamlParseException - Position 32:18. Can not set the content of androidWidgetv7:CardView as it doesn't have a ContentPropertyAttribute
网上没有任何例子说明如何做到这一点。有人知道吗?