ValueChanged event is not fired for UITextField - Xamarin IOS

MuthuMKMuthuMK GBMember ✭✭

Xamarin IOS value change event doesn't fire. I tried in two different ways. But still no luck. Can some one help me please.

1) textField4.ValueChanged += delegate
{
new UIAlertView("test", "text 4 changed", null, "Ok",null).Show();
};

2) textField4.AddTarget((s, e) =>
{
new UIAlertView("test", "text 4 changed", null, "Ok", null).Show();
}, UIControlEvent.EditingChanged);

Answers

  • Th3CollectorTh3Collector BGMember ✭✭
    edited August 7

    Try this :)

    public override void ViewDidLoad()
        {
                base.ViewDidLoad();
    
        textField4.AddTarget(ValueChanged,UIControlEvent.EditingChanged);
    }
    
    private void ValueChanged(object sender, EventArgs e)
        {
           //do stuff
        }
    
Sign In or Register to comment.