Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement