如何在iOS中为UITextFields
实现自定义键盘,如上图所示
其实我是这样尝试的
- (IBAction)button2ABC:(id)sender
{
keypadValue=@"2";
if ([textFields_tag isEqualToString:@"one"]){
pswdTxt1.text=keypadValue;
pswdTxt1.text=[keypadValue stringByAppendingString:keypadValue];
}
else if ([textFields_tag isEqualToString:@"two"]){
pswdTxt2.text=keypadValue;
}
else if ([textFields_tag isEqualToString:@"three"]){
pswdTxt3.text=keypadValue;
}
else if ([textFields_tag isEqualToString:@"four"]){
PswdTxt4.text=keypadValue;
}
}
每当我选择UITextfield
该字符正在替换而不附加前一个字符时按下按钮。