Forum Xamarin.Forms

Custom Rendering every Visual Element for Swipe Gestures?

SaschaHSaschaH DEMember ✭✭

We wanted to have own Views for Tab Buttons so we built a custom Tabbed Page.
Now we want to make it swipable.
I started making a custom renderer for StackLayouts, because in every Tab is a stacklayout with all its content.
But this didnt work because if you tried to swipe on anything except a stacklayout it wouldnt swipe.
This is clear to us.
So next step was trying to Render every Visual Element but this resulted in just seeing their containers in the corresponding BackgroundColor.
Buttons, TextViews etc. were all just not visible...
But their containers were swipable jippie! ... :/

So is there any other approach on this whole Gesture-thing?
Even if it would be global, well we tried it too... In the android activity. But the Gestures weren't detected.

Answers

  • JKayJKay USMember ✭✭✭

    mrgestures.com/ Best $10 you'll ever spend

  • SaschaHSaschaH DEMember ✭✭

    Its just not what i want. You have to implement gestures on every element, i just want a global gesture detection

  • SaschaHSaschaH DEMember ✭✭

    bump

  • DavidStrickland0DavidStrickland0 USMember ✭✭✭
    edited October 2015

    Im working on a gesture Library Atm. Currently the codes in a bit of disarray because of ... well thats coding for ya.

    However it might give you some ideas basically its the same thing you already tried however Im not getting the containers but no controls issue you were mentioning. If you wait a day or two I should have the whole thing wired back together but if you want to see the direction I'm headed its over at.

    https://github.com/Indiponics/IndiXam-Lib

    atm it only supports Image and Label but adding more controls wont be hard (as you'd see in the code).

    However it still requires you to state what you want to do when the guesture is recognized. You could just add the same recognizer to every element but it would have to be done. Making the Recognition of gestures global can be done but somehow you have to state what you want to do on each gesture and that is going to have to be wired to every element somehow. If by nothing else you'd need a recursive foreach to iterate threw everything and set it.

    Qucick Note: ATM its Android only. I haven't added IOS and WP yet. Again I'm just getting started with it still needs a lot more work but it might give you some ideas.

Sign In or Register to comment.