首页 > 移动平台 > 详细

iOS 实现隐藏系统键盘

时间:2014-04-24 15:55:34      阅读:601      评论:0      收藏:0      [点我收藏+]

实现隐藏系统键盘,显示自定义键盘吧;

UITextfield获取焦点时,进入textFieldShouldBeginEditing方法,在这个方法中注册两个通知:

[[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWasShown:)
                                                     name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(keyboardWillShow:)
                                                     name:UIKeyboardWillShowNotification object:nil];

//隐藏系统键盘

- (void)keyboardWillShow:(NSNotification *)Notification{
    UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
    [tempWindow setAlpha:0];
}

//显示自定义键盘

- (void)keyboardWasShown:(NSNotification *) Notification{
// 添加显示你的自定义键盘 }

iOS 实现隐藏系统键盘,布布扣,bubuko.com

iOS 实现隐藏系统键盘

原文:http://www.cnblogs.com/wuwangchuxin/p/3683089.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!