Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Performance issue : custom render + GestureRecognizers

$
0
0

Hi, have a simple custom render for images. It works like a charm in iOS but it has serious performance issues on Android.
It simply set a "selector" , changing the image for normal and pressed state.
It does its honest work until i attach a GestureRecognizer.

A) normal behaviour :
1) i click on the "imagebutton" and the image changes.
2) i release "image" and image goes to normal state

B) After attaching GestureRecognizer :

1) i click on the imagebutton and the image goes to "pressed_state"
2) i release the finger but image stays on pressed state
3) i press again over the button and the button behave like a toggle button.
4) Wherever i click (on the screen) all the image buttons react to click (so if i touch the top of the screen, all buttons reacts)
5) It's all too sloooooooooooow

this is the page :

    public partial class RCStandardPage : ContentPage
{
    public RCStandardPage ()
    {
        InitializeComponent ();

        var tapGestureRecognizer = new TapGestureRecognizer();
        tapGestureRecognizer.Tapped += (s, e) => {

            // nothing here 
        };


        btnStart.GestureRecognizers.Add (tapGestureRecognizer);
        btnStop.GestureRecognizers.Add (tapGestureRecognizer);
    }
}

Attached screenshot of android version of renderer and the simple page.

Any ideas ?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>