gpt4 book ai didi

objective-c - 如何从虚拟键盘 IOS 中删除上一个下一个按钮

转载 作者:太空狗 更新时间:2023-10-30 03:40:07 24 4
gpt4 key购买 nike

我在 IOS 5 中使用了 UIWebview。我尝试设置 contenteditable="true" 以使 uiwebview 可编辑。

我的应用程序的屏幕截图类似于此链接中的图片 How do you remove the Next and Prev buttons from virtual keyboard in Sencha Touch / Phonegap application ,

enter image description here

我的问题是我想从键盘上删除这个上一个和下一个按钮,但我不知道该怎么做。有人可以帮助我吗?

谢谢

最佳答案

这是一个旧答案,不再适用于 iOS 9。有关更新的解决方案,请参阅我的答案 here .


这是一个灰色地带,但肯定有可能。

参见此处:http://ios-blog.co.uk/iphone-development-tutorials/rich-text-editing-a-simple-start-part-1/

注册键盘显示通知:

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

然后:

- (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];
}
}
}
}
}

关于objective-c - 如何从虚拟键盘 IOS 中删除上一个下一个按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8470984/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com