开发者

how to force user to stay in a specific UITextfield

inside my app i have an UITextfield to let the user to enter Email Address. I implement the delegate method -(void)textFieldDidEndEditing:(UITextField *)textField to check if the user have had entered a valid Email Address. The Problem is how to let the cursor stuck inside the Email Address textfield while the verification method returns false and out wh开发者_Python百科en the user enter a valid Email.


I am guessing you have the email address checked inside textFieldDidEndEditing. Use this logic in that method.

if (validEmail)
      {
        // Not a problem and resignFirstResponder
      }

else

      {
       // Show an UIAlertView describing the problem //

       [textField becomeFirstResponder];

      }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜