本文介绍了CarouselView在Xamarin.Forms中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用CarouselView,我已经安装了它(CarouselView.FormsPlugin),并且检查了项目的packeges.config,并且它已经存在:

I would like to use CarouselView , I have installed it already (CarouselView.FormsPlugin) and I checked the packeges.config of my project and it is already there :

但仍然出现此错误 在全局名称空间中找不到类型或名称空间名称"CarouselView"(您是否缺少程序集引用?)我该如何解决这个问题?

but still I am getting this error The type or namespace name 'CarouselView' could not be found in the global namespace (are you missing an assembly reference?)how can I fix this problem?

推荐答案

您似乎没有使用官方的CarouselView.对于 CarouselView.FormsPlugin ,名称为CarouselViewControl.

It looks like you're not using the official CarouselView. In the case of the CarouselView.FormsPlugin, the name is a CarouselViewControl.

像这样尝试:

<controls:CarouselViewControl x:Name="myView">
    <controls:CarouselViewControl.ItemTemplate>
            <DataTemplate>
                <Label Text="{Binding .}" HorizontalOptions="Center" VerticalOptions="Center"/>

            </DataTemplate>
        </controls:CarouselViewControl.ItemTemplate>
    </controls:CarouselViewControl>

这篇关于CarouselView在Xamarin.Forms中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 23:26