无法将“StackLayout”类型的值添加到“IList”类型的集合或字典中

Ufu*_*man 2 xamarin xamarin.forms

我有错误:“StackLayout”类型的值不能添加到“IList”类型的集合或字典中

 <StackLayout x:Name="Contunie" Margin="0" HeightRequest="80" HorizontalOptions="FillAndExpand" VerticalOptions="EndAndExpand" BackgroundColor="#24348b">
                <StackLayout.GestureRecognizers>
                    <TapGestureRecognizer Tapped="Contunie_Tapped"></TapGestureRecognizer>
                </StackLayout.GestureRecognizers>
                <Label Font="20" Margin="0,15,0,0"  HorizontalOptions="CenterAndExpand" TextColor="White"  
                   FontFamily="{DynamicResource GothamRoundedMedium}" Text="{Translator:Translate SendMessage}" BackgroundColor="Transparent"></Label>
            </StackLayout>
Run Code Online (Sandbox Code Playgroud)

小智 7

我遇到过同样的问题。重建将摆脱这个问题。如果您的 xaml 确实有问题,您的页面很可能无法加载。