Xamarin Forms carousel with menu/tabs

I want do create something like TabbedPage but as a View with scrollable "menu" ( I will have about 8 tabs). How can I achive this? I was thinking about doing CarouselView and somehow to make a tabbed header, but I dont know how to make it good. Or maybe there is a plugin for TabbedView ( I spent few hours and I didn't find anything). Thanks in advance.

2 answers

  • answered 2018-12-05 22:36 Michael C.

    Xamarin.Forms does not provide a TabView control but only a TabbedPage which seems to be no good in your case. There are commercial third party libraries that offer such a control out of the box (e.g. from SyncFusion). I looked quite a long time into this issue. Finally, I went for creating my own implementation which is based on a data bindable StackLayout with a horizontal line of buttons. Only the ContentView that is associated with the selected button is shown all other ones are hidden.

  • answered 2018-12-06 09:03 James Mallon

    James Montemagno made a a brilliant blog on how to implement this a couple of years ago.

    That sorts out the Carousel View. Now to write the tabbed header I wrote 1 of these a couple of years back. What you need to do is make a stacklayout with orientation horizontal, make the width bigger than the screen width and then every new page you visit you can translate the top bars x coordinates to the left or right. and change the image in the bar so that it looks highlighted.

    Have a real play with this, see if you can make the transitions between pages smooth and the translation look sleek. I managed to do it so Im sure you will be fine.

    I would provide code but unfortunately it was for a client and I cannot share his intellectual property.