Forum Xamarin Xamarin.iOS

Textfield TouchUpInside

I would like to have a textfield that you can click and a UIAlert will be shown. I am not sure how to implement this because when I try I get an error??
Please help!

this.txtReferenceField.TouchUpInside += ShowAlert();


  • adamkempadamkemp USInsider, Developer Group Leader mod

    It looks like maybe you need to look into how C# events work first. Once you've done that, though, I suggest you use a button with text (customized perhaps) rather than a text field. It doesn't make a whole lot of sense to use a text field if you're going to override the touch behavior.

  • A workaround to use a UITextField like a button, when "touchupinside" do something like show an UIAlert, can be handle the EditingDidBegin event of UITextField.

    For example:

    MyTextField.EditingDidBegin += (object sender, EventArgs e)




    I don't try the code but I remember something like this.

Sign In or Register to comment.