SHARE
TWEET

Untitled

a guest Jun 26th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public override void ViewDidLoad ()
  2. {
  3.     // Perform any additional setup after loading the view
  4.  
  5.     UIButton button = new UIButton (new System.Drawing.RectangleF(100, 100, 100, 30));
  6.     button.SetBackgroundImage ("imageNeeded", UIControlState.Normal);
  7.     var gestureRecognizer = new UILongPressGestureRecognizer ();
  8.     gestureRecognizer.AddTarget(() => this.ButtonLongPressed(gestureRecognizer));
  9.     button.AddGestureRecognizer(gestureRecognizer);
  10.     this.View.Add (button);
  11. }
  12.  
  13. public void ButtonLongPressed(UILongPressGestureRecognizer gestureRecognizer)
  14. {
  15.     if (gestureRecognizer.State != UIGestureRecognizerState.Began)
  16.     {
  17.           return;
  18.           // Needed because selector is executed twice, because Long-press gestures are continuous
  19.     }
  20.     // Perform action of opening the dialog to select/take a picture, replacing the ? image with the new image
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top