我發現的iOS 8.解決方法您可以點擊此處查看:
-(void) removeKeyboard {
UIWindow *keyboardWindow = nil;
for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {
if (![[testWindow class] isEqual : [UIWindow class]]) {
keyboardWindow = testWindow;
break;
}
}
// Locate UIWebFormView.
for (UIView *possibleFormView in [keyboardWindow subviews]) {
if ([[possibleFormView description] hasPrefix : @"<UIInputSetContainerView"]) {
for (UIView* peripheralView in possibleFormView.subviews) {
for (UIView* peripheralView_sub in peripheralView.subviews) {
// hides the backdrop (iOS 8)
if ([[peripheralView_sub description] hasPrefix : @"<UIKBInputBackdropView"] && peripheralView_sub.frame.size.height == 44) {
[[peripheralView_sub layer] setOpacity : 0.0];
}
// hides the accessory bar
if ([[peripheralView_sub description] hasPrefix : @"<UIWebFormAccessory"]) {
for (UIView* UIInputViewContent_sub in peripheralView_sub.subviews) {
CGRect frame1 = UIInputViewContent_sub.frame;
frame1.size.height = 0;
peripheralView_sub.frame = frame1;
UIInputViewContent_sub.frame = frame1;
[[peripheralView_sub layer] setOpacity : 0.0];
}
CGRect viewBounds = peripheralView_sub.frame;
viewBounds.size.height = 0;
peripheralView_sub.frame = viewBounds;
}
}
}
}
}
}
您可以嘗試和改進這一點。嘗試在您的UIKeyboardDidShowNotification事件處理程序中調用此函數。
希望這有助於... 這是意見附件級別: (UIWebFormAccessory) - >(UIToolbar) - >(的UIImageView,UIToolbarButton,UIToolbarButton)
我發現的iOS 8.您的解決方案可以在這裏檢查:iOS 8 - 刪除UIWebView中的上一個/下一個/完成UIKeyboard工具欄http://stackoverflow.com/questions/25022089/remove-next-previous-buttons-inputaccessory-for-custom-keyboard-in-ios8 – Gaurav