我环顾四周,我不确定iOS 5中是否已解决此问题。我找到了这篇文章
return or done button in iOS 5
下面有一些代码,但我不知道我应该把它放在哪里?
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.2) {
if([[keyboard description] hasPrefix:@"<UIPeripheralHost"] == YES)
[keyboard addSubview:doneButton];
} else {
if([[keyboard description] hasPrefix:@"<UIKeyboard"] == YES)
[keyboard addSubview:doneButton];
}
答案 0 :(得分:2)
首先为UIKeyboardDidShowNotification添加观察者,如下所示:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidShow:)
name:UIKeyboardDidShowNotification
object:nil];
并在keyboardDidShow中:编写此代码以添加完成按钮