how to remove prev next button from virtual keyboard IOS

后端 未结 4 541
独厮守ぢ
独厮守ぢ 2020-12-09 01:03

i have use a UIWebview in IOS 5. I try to set contenteditable=\"true\" to make uiwebview editable.

The screenshoot of my app is similar to an image in

4条回答
  •  情话喂你
    2020-12-09 01:07

    This is an old answer and is no longer working on iOS 9. For an updated solution, see my answer here.


    It is a gray-area, but certainly possible.

    See here: http://ios-blog.co.uk/iphone-development-tutorials/rich-text-editing-a-simple-start-part-1/

    Register for notification on keyboard showing:

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

    Then:

    - (void)keyboardWillShow:(NSNotification *)note {
        [self performSelector:@selector(removeBar) withObject:nil afterDelay:0];
    }
    
    - (void)removeBar {
        // Locate non-UIWindow.
        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]) {       
            // iOS 5 sticks the UIWebFormView inside a UIPeripheralHostView.
            if ([[possibleFormView description] rangeOfString:@"UIPeripheralHostView"].location != NSNotFound) {
                for (UIView *subviewWhichIsPossibleFormView in [possibleFormView subviews]) {
                    if ([[subviewWhichIsPossibleFormView description] rangeOfString:@"UIWebFormAccessory"].location != NSNotFound) {
                        [subviewWhichIsPossibleFormView removeFromSuperview];
                    }
                }
            }
        }
    }
    

提交回复
热议问题