VS 2017中的Xamarin表单。最新的Xamarin表单。
在此博客https://blog.xamarin.com/adding-bindable-native-views-direct-to-xaml/?utm_medium=social&utm_campaign=blog&utm_source=twitter&utm_content=xaml-bindable-native-views后面,我向其中添加了一个简单的Android TextBox页面,但它不会出现。
我想念什么吗?
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:androidWidget="clr-namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android"
xmlns:formsandroid="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.Platform.Android;targetPlatform=Android"
xmlns:controls="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin.Abstractions"
xmlns:widget="clr-namespace:Android.Support.Design.Widget;assembly=Xamarin.Android.Support.Design"
x:Class="Muffin.MainPage">
<StackLayout>
<androidWidget:TextView x:Arguments="{x:Static formsandroid:Forms.Context}" Text="this is the text" />
</StackLayout>
如果启用了XAMLC(XAML编译),则似乎无法执行此操作。一旦我禁用它就可以了
您不能在具有本机视图的任何页面上启用XamlC。您不能在任何本机视图控件上使用x:Name
//NO NO -> [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句