IOS keyboard color change code
This article mainly introduces IOS keyboard color change code, which is very simple and practical. For more information, see.
IOS code for changing the keyboard color
The keyboard color of the iPhone and iPod touch can be changed by code, which can better match the interface style of the App. The following is the code for changing the iPhone keyboard color.
1. Only the Number Pad and Phone Pad types can work.
2. Set Appearance to Alert.
The Code is as follows:
-(Void) textFieldDidBeginEditing :( UITextField *) textField {
NSArray * ws = [[UIApplication sharedApplication] windows];
For (UIView * w in ws ){
NSArray * vs = [w subviews];
For (UIView * v in ){
If ([[NSString stringwithuf8string: object_getClassName (v)] isEqualToString: @ "UIPeripheralHostView"]) {
V. backgroundColor = [UIColor redColor];
}
}
}
}
The above is all the content of this article. I hope you will like it.