我在Xamarin.Forms中有一个测试页,它使我得到此错误,我该如何解决?
Property Content is null or is not IEnumerable
Xaml:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Project1.Page1">
<ContentPage.Content>
<Label Text="Page"></Label>
<Editor Text="I am an Editor" />
</ContentPage.Content>
</ContentPage>
最佳答案
Content
属性的类型为View
。您不能对此有两个 View 。替换为
<StackLayout >
<Label Text="Page"></Label>
<Editor Text="I am an Editor" />
<StackLayout>
关于xaml - 属性内容为null或IEnumerable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38099252/