Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

AddGestureRecognizer to UIBarButtonItem (to detect long press)

$
0
0

Hi all,

when I'd like to detect a long press on a UIBarButtonItem in my NavigationBar.

           var longPressRecogniser = new UILongPressGestureRecognizer(OnFilterLongPress);
            NavigationItem.LeftBarButtonItems[0].AddGestureRecognizer(longPressRecogniser);

But then I get this error: 'MonoTouch.UIKit.UIBarButtonItem' does not contain a definition for 'AddGestureRecognizer' and no extension method 'AddGestureRecognizer' accepting a first argument of type 'MonoTouch.UIKit.UIBarButtonItem' could be found (are you missing a using directive or an assembly reference?)

Is there absolutely no way to do this?

Thanks!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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