简体   繁体   English

在带有 CarouselView 的 Xamarin.Forms 中显示部分上一个/下一个视图

[英]Showing partial of prev/next view in Xamarin.Forms w/ CarouselView

I am very new to Xamarin.Forms and I stumbled upon the github project CarouselView .我对 Xamarin.Forms 非常陌生,我偶然发现了 github 项目CarouselView I think it is almost perfect for what I want to do.我认为这对于我想做的事情来说几乎是完美的。 I want to adapt it to show the previous and next views in the list.我想调整它以显示列表中的上一个和下一个视图。 I don't need to worry about the content within those views.我不需要担心这些视图中的内容。 I just want to be able to modify each view so that I can see a preview of the previous and next item in the list.我只想能够修改每个视图,以便我可以看到列表中上一个和下一个项目的预览。 Kinda like the image below.有点像下图。 Can anyone guide me in the right direction on how to achieve this?任何人都可以指导我如何实现这一目标的正确方向吗?

在此处输入图片说明

CarouselView is now part of Xamarin Forms. CarouselView 现在是 Xamarin Forms 的一部分。 They added property PeekAreaInsets which takes in thickness value.他们添加了接收厚度值的属性PeekAreaInsets Adjusting it will result in making items partially visible.调整它会使项目部分可见。 Hope this helps someone.希望这可以帮助某人。

Carousel Page of Xamarin.Forms has an event so you can handle the change, this is something you can do: Xamarin.Forms 的 Carousel 页面有一个事件,因此您可以处理更改,这是您可以执行的操作:

CarouselPage t = new CarouselPage();
t.CurrentPageChanged += (object sender, EventArgs e) => {
    if(t.CurrentPage.Title == "Title 1"){
      //Then Change your number to 2 or 3 or what ever
      //Your Label.Text = 2,3,4 maybe handle this with a switch.
      //3/5 Page
    }
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM