Forum Xamarin.iOS

Why doesn't touchesBegan work as suggested?

nikkanikka USMember ✭✭
edited January 2017 in Xamarin.iOS

This answer says that by overriding touchesBegan I should be able to deselect uitextfields when clicking outside of it, but this method doesn't get called when i click outside of the uitextfield, which makes it useless. What's wrong with my code?

[Register("UITextFieldAv")]
class UITextFieldAv : UITextField
{
    public override void TouchesBegan(NSSet touches, UIEvent evt)
    {
        this.EndEditing(true);
    }

} 
Sign In or Register to comment.