2012-07-30 73 views

回答

3

您可以尝试的代码

your_TextField.inputView = your_CustomKeyboard; 

以下行,我不确认,它会为你的自定义键盘工作,我想这使用日期选择为inputview和它没有工作所以它可以帮助你

-1

您需要隐藏默认键盘以显示您的自定义键盘。所以使用这个: -

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];和方法keyboardDidHide:,加[keyboard resignFirstResponder]

0

我得到了我的问题的答案。因为我是新来的,所以我在我自己的问题发布后8个小时后发布了答案。是的,Tejeshwar Gill,感谢您的回应,我的解决方案与您的方法相符。再次感谢。

我使用NSNotificationCenter在出现键盘时通知我。当键盘出现时,我曾经使用这种方法来调整我的tableview的大小,但那是相当长的一段时间。所以它没有立即点击我。

[[NSNotificationCenter defaultCenter]的addObserver:自 选择器:@selector(hideKeyboard :) 名:UIKeyboardWillShowNotification 对象:无];

+0

所以在你的hideKeyboard方法中,你做了什么?你能告诉我们代码吗? – pdschuller 2013-05-09 15:26:20