1、只有Number Pad和Phone Pad这两种数字键盘才有效果
2、设置Appearance为Alert
代码如下:
- (void)textFieldDidBeginEditing:(UITextField *)textField{
NSArray *ws = [[UIApplication sharedApplication] windows];
for(UIView *w in ws){
NSArray *vs = [w subviews];
for(UIView *v in vs){
if([[NSString stringWithUTF8String:object_getClassName(v)] isEqualToString:@"UIPeripheralHostView"]){
v.backgroundColor = [UIColor redColor];
}
}
}
}
以上所述就是本文的全部内容了,希望大家能够喜欢。