In a view controller I have a 2 text boxes (UITextField) and a submit button. The text boxes pop up the ASCII keyboard. The Submit button takes the values from the text boxes and does something with them.
Using Xamarin Studio 4.0.12
Thank you!
You need to do what incmiko suggested. Here's the code in C#
Part 1.
txtUsername.ShouldReturn = TextFieldShouldReturn;
txtPassword.ShouldReturn = TextFieldShouldReturn;
create a function in your view
private bool TextFieldShouldReturn(UITextField tf)
{
//change the code below as per your validation
if (tf == _txtUsername)
{
_txtPassword.BecomeFirstResponder();
return true;
}
if(tf == _txtPassword)
{
// validate field inputs as per your requirement
tf.ResignFirstResponder();
return true;
}
return true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With