1

I am very new to Xamarin.Forms and I stumbled upon the github project 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?

enter image description here

Travyguy9
  • 4,774
  • 8
  • 43
  • 63

2 Answers2

2

CarouselView is now part of Xamarin Forms. They added property PeekAreaInsets which takes in thickness value. Adjusting it will result in making items partially visible. Hope this helps someone.

Darko
  • 89
  • 1
  • 7
  • 1
    Old question of mine, but yes, now-a-days they have it pretty much built-in. I marked it as answer since it is the answer technically going forward. – Travyguy9 Feb 21 '20 at 17:07
0

Carousel Page of Xamarin.Forms has an event so you can handle the change, this is something you can do:

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
    }
};
Mario Galván
  • 3,964
  • 6
  • 29
  • 39
  • I may have to reword my question but I dont need the Title text changed. I want to basically change how each "view" is drawn so that I can see the previous and next view but only partially. – Travyguy9 Mar 08 '16 at 17:27
  • Ooooh I got you, I thought you wanted something like an indicator of the page (3 of 5 pages), but there is component for that (only for iOS tho): https://components.xamarin.com/view/Alliance.Carousel if that is not a good solution then you will have to create a custom renderer (for iOS and Android) for that: https://forums.xamarin.com/discussion/19395/carousel-view-custom-renderer-alternative – Mario Galván Mar 08 '16 at 18:06
  • Well the control I listed above is using a custom renderer for iOS and Android but I am unsure how to tell it to draw the individual views to be smaller so I can see the previous and next view. – Travyguy9 Mar 08 '16 at 18:24
  • Looks like a custom renderer is the way, here is some insights on Native Android: http://stackoverflow.com/questions/13914609/viewpager-with-previous-and-next-page-boundaries – Mario Galván Mar 08 '16 at 18:41
  • Cool thanks. Ive seen that done for Android and I tried it but just can get it to draw the same. Was hoping someone could give me some pointers or sample code maybe? – Travyguy9 Mar 08 '16 at 18:47