Search code examples
androidxamarin.formstabbedpage

How to disable only the tab swiping and allow gesture recognizer to swipe in tab


As the question says, I need to enable the content page swiping which is a child of a tabbed page. But the siping for the tabbed page should be disabled.

I have gone through the various post but by using them I can able disable the swiping for the tabbed page but I am not able to use the GestureRecognizer events in children views.

I tried this: Xamarin Forms Disable swipe between pages in TabbedPage

Can anyone help me with this, please?


Solution

  • So there seems to be a bug or if not a bug a specific behavior that when you disable page swiping for the tabbed page, gesture recognizer won't work.

    If what you want to achieve is a carousel inside a child tabbed page you can use CarouselView from AlexRainMan which works great even when IsSwipePagingEnabled is set to False.

    https://github.com/alexrainman/CarouselView

    I have prepared a sample for you that is working on Android, did not test it on iOS :

    https://github.com/vincentcastagna/TabbedPageWithCarouselView

    The carousel is implemented in the AboutPage (and it is minimalist)