键盘回收事件

来源:互联网 发布:string 转 日历 java 编辑:程序博客网 时间:2024/06/07 14:52

函数

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

    UITouch *touch = [touches anyObject] ;

    if (![touch.viewisMemberOfClass:[UITextFieldclass]]) {

        [self.textresignFirstResponder] ;

    }

}



设置键盘的颜色 系统默认提供了四种:

 text.keyboardAppearance=UIKeyboardAppearanceDark;

 text.keyboardAppearance=UIKeyboardAppearanceAlert;

 text.keyboardAppearance=UIKeyboardAppearanceDefault;

 text.keyboardAppearance=UIKeyboardAppearanceLight;

typedef enum {
UIKeyboardAppearanceDefault, 默认外观,浅灰色
UIKeyboardAppearanceAlert,   深灰 石墨色
} UIReturnKeyType;