首页 > 解决方案 > 我正在工作 Xamarin.forms 并在 xaml 文件中收到此错误

问题描述

错误:属性

我尝试删除一个子布局,但没有奏效。

标签: androidvisual-studioxamlxamarin.forms

解决方案


在 aPage中,您只能有一个布局元素。在该布局元素内,您可以拥有无​​限的嵌套元素。

因此,您现在拥有的所有内容都应该根据您的需要包装在 StackLayout、Grid 或类似文件中。

像这样:

<ContentPage> 
    <StackLayout>
        <!-- Your current layout -->
    </StackLayout>
</ContentPage>

推荐阅读