- (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]; } } } }
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/5248.html