我非常想找出意外关闭我的xamarin android项目的原因。我在xaml页面中使用过CarouselView。当我导航到该页面时,应用程序意外崩溃,但在运行ios项目时它工作正常。其实我正在研究便携式项目。你能否就这个问题提出任何建议。我发布了我的hockeyapp崩溃报告。我认为这将有助于确定,究竟是什么原因。谢谢。
这是曲棍球应用程序崩溃报告
这是我的代码
<cv:CarouselView VerticalOptions = "FillAndExpand" HorizontalOptions =
"FillAndExpand" Position = "{Binding DishCategory}" ItemSelected =
"OnSwipeDishesHandler" ItemsSource = "{Binding RestaurantDishesList}"
x:Name = "RestaurantDishesList">
<cv:CarouselView.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="230" Tablet ="630"/>
</cv:CarouselView.HeightRequest>
<cv:CarouselView.ItemTemplate>
<DataTemplate>
<StackLayout Padding = "10,5,10,5" Orientation = "Vertical">
<ListView x:Name="RestaurantMenuListView" BackgroundColor="Transparent" ItemsSource="{Binding CategoryWiseDishes}" HasUnevenRows="true" SeparatorColor="#eeeeee" ItemTapped="OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="7">
<Grid Padding="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="OnMenuItemSelected"/>
</StackLayout.GestureRecognizers>
<Label Text="{Binding Name}" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="15" Tablet ="20"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Description}" TextColor="#323232">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="11" Tablet ="16"/>
</Label.FontSize>
</Label>
<StackLayout Orientation="Horizontal">
<Label Text="£" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="14" Tablet ="19"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Cost}" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="14" Tablet ="19"/>
</Label.FontSize>
</Label>
</StackLayout>
</StackLayout>
<StackLayout Grid.Column="1" Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Image Source="minus.png">
<Image.WidthRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.WidthRequest>
<Image.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.HeightRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="RemoveItemBtnClicked"/>
</Image.GestureRecognizers>
</Image>
<Label Text="{Binding TotalQuantity}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="13" WinPhone="13" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="15" Android="15" WinPhone="15" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
<Image Source="add.png">
<Image.WidthRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.WidthRequest>
<Image.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.HeightRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="AddItemBtnClicked"/>
</Image.GestureRecognizers>
</Image>
</StackLayout>
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</DataTemplate>
</cv:CarouselView.ItemTemplate>
</cv:CarouselView>