我的UITextField
:
if (passwordStr.length == 0)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Invalid Password"
message:@"You must enter a password."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
hasError = YES;
[_password setRightViewMode:UITextFieldViewModeUnlessEditing];
_password.rightView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"rsz_logoblack.png"]];
}
我想让代码稍后清除_password UITextfield
(无文本)并删除正确的图片并将其恢复为默认Textfield
。
答案 0 :(得分:0)
这样的东西?
_password.text = @"";
_password.rightView = nil;