When a UITextField receives focus, I want the text inside of it to be automatically selected so that anything the user types overwrites it. I've tried the following, but nothing work (iOS 7.1.1):
UserNameField.EditingDidBegin += (object sender, EventArgs e) =>
{
UserNameField.SelectAll(this);
};
or
UserNameField.EditingDidBegin += (object sender, EventArgs e) =>
{
UserNameField.GetTextRange (UserNameField.BeginningOfDocument, UserNameField.EndOfDocument);
};
Has anybody experiences with that?
Thanks