我在我的项目上尝试CarouselView。但是当我运行我的项目时,我会发现这个错误。

这是我的xaml代码;
<?xml version="1.0" encoding="UTF-8"?>
<base:HotelDetailPageXaml
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamarinCRM.Pages.Hotels.HotelDetailPage"
xmlns:statics="clr-namespace:XamarinCRM.Statics"
xmlns:base="clr-namespace:XamarinCRM.Pages.Hotels"
xmlns:hotelViews="clr-namespace:XamarinCRM.Views.Hotels"
xmlns:i18n="clr-namespace:XamarinCRM.Localization"
xmlns:cv="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.CarouselView"
Title="{Binding Hotel.Name}">
<base:HotelDetailPageXaml.Content>
<StackLayout Spacing="0">
<cv:CarouselView ItemsSource="{Binding Hotel.HotelImages}">
<cv:CarouselView.ItemTemplate>
<DataTemplate>
<StackLayout HeightRequest="200">
<Image HeightRequest="200" Aspect="AspectFill" Source="{Binding FullPath}"/>
</StackLayout>
</DataTemplate>
</cv:CarouselView.ItemTemplate>
</cv:CarouselView>
</StackLayout>
</base:HotelDetailPageXaml.Content>
</base:HotelDetailPageXaml>这就是我叫json服务;
public async Task<IEnumerable<HotelModel>> GetHotelsAsync(bool includeLeads = false)
{
string path = "my service url";
HttpClient Client = new HttpClient();
var task = await Client.GetAsync(path);
var jsonString = await task.Content.ReadAsStringAsync();
List<HotelModel> hotelList = new List<HotelModel>();
List<HotelImageModel> hotelImageList = new List<HotelImageModel>();
dynamic json = JsonConvert.DeserializeObject(jsonString);
for (int j = 0; j < 10; j++)
{
HotelImageModel hotelImage = new HotelImageModel();
hotelImage.FullPath = json["data"][i]["HotelImages"][j]["FullPath"].Value;
hotel.HotelImages.Add(hotelImage);
}
}I是酒店索引编号for,j是酒店形象索引号。
发布于 2016-08-08 11:59:13
在Xamarin论坛上,报告这个错误就像错误一样是相同的错误。6月21日
https://forums.xamarin.com/discussion/69483/why-does-carouselview-crash-on-android
您安装了什么版本的Xamarin?你试着安装最新版本的xamarin?
https://stackoverflow.com/questions/38827692
复制相似问题