iphone 更改鍵盤背景顏色

modun1986發表於2011-05-24

轉載自:http://www.cocoachina.com/bbs/read.php?tid-12244.html

 

- (void)textViewDidBeginEditing:(UITextView *)textView{
    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:@"UIKeyboard"]){
                v.backgroundColor = [UIColor redColor];
            }
        }
    }
}
 

相關文章