Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xaml 使用Fontsize、FontAttributes和HorizontalOptions时出现未处理的异常错误_Xaml_Xamarin_Xamarin.forms - Fatal编程技术网

Xaml 使用Fontsize、FontAttributes和HorizontalOptions时出现未处理的异常错误

Xaml 使用Fontsize、FontAttributes和HorizontalOptions时出现未处理的异常错误,xaml,xamarin,xamarin.forms,Xaml,Xamarin,Xamarin.forms,以下代码由于某种原因正在中断,但当我删除FontSize=“Large”fonttributes=“Bold”时 HorizontalOptions=“Center”,它工作正常。它抛出一个未处理的异常,我无法部署到模拟器。为什么? <ContentPage.Content> <ListView x:Name="GrouppedList" ItemsSource="{Binding Rss.channel.item}"> &l

以下代码由于某种原因正在中断,但当我删除FontSize=“Large”fonttributes=“Bold”时 HorizontalOptions=“Center”,它工作正常。它抛出一个未处理的异常,我无法部署到模拟器。为什么?

  <ContentPage.Content>
    <ListView x:Name="GrouppedList"
           ItemsSource="{Binding Rss.channel.item}">
      <ListView.ItemTemplate>
        <DataTemplate>
          <TextCell Text="{Binding title}" Detail="{Binding description}"   FontSize="Large" FontAttributes="Bold"
         HorizontalOptions="Center" />             
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
  </ContentPage.Content>


FontAttributes、FontSize和HorizontalOptions不是TextCell的属性。如果您想进一步自定义它,您需要转到ViewCell。

这很奇怪,因为我在VS上没有收到任何编译错误,但只有在我开始部署到Emulator时,它才会抛出和异常,我花了几个小时才发现这一点,因为异常也没有任何具体信息。除非您使用XamlC,Xaml是在运行时编译的,而不是在生成时编译的。我以为您可以构建它,但在尝试运行时失败了。