UIWebview
клавиатура содержит следующий, предыдущие кнопки как (<,>). Мне нужно добавить настраиваемый toolBar для панели инструментов UIWebView
KeyBoard. Пожалуйста, посоветуй мне. Я настроен в прошивке 8, но он не работает для прошивки 7.Как изменить панель инструментов клавиатуры UIWebView в iOS 7?
- (void) addCustomToolBarForWebViewKeyBoardToolBar
{
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) {
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"]) {
UIToolbar *toolBar = [self findWebKeyboardToolbar:peripheralView_sub];
if (toolBar){
editableToolBar=toolBar;
[self checkSelection:self];
return;
}
}
}
}
}
}
}
- (UIToolbar *)findWebKeyboardToolbar:(UIView *)parent
{
if ([parent isKindOfClass:[UIToolbar class]]) {
// the stock toolbar contains a single item with a UISegmentedControl customView.
UIToolbar *tb = (UIToolbar *)parent;
return tb;
}
for (UIView *view in parent.subviews) {
UIToolbar *tb = [self findWebKeyboardToolbar:view];
if (tb) return tb;
}
return nil;
}