IOS keyboard color change code

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.