how to remove prev next button from virtual keyboard IOS(如何从虚拟键盘IOS中删除上一个下一个按钮)
问题描述
我在 IOS 5 中使用了 UIWebview.我尝试设置 contenteditable="true"
以使 uiwebview 可编辑.
我的应用程序的屏幕截图类似于此链接中的图像 .
<小时>这是一个灰色地带,但肯定有可能.
见这里:http://ios-blog.co.uk/iphone-development-tutorials/rich-text-editing-a-simple-start-part-1/
注册键盘显示通知:
[[NSNotificationCenter defaultCenter] addObserver:self 选择器:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
然后:
- (void)keyboardWillShow:(NSNotification *)note {[self performSelector:@selector(removeBar) withObject:nil afterDelay:0];}- (void)removeBar {//定位非 UIWindow.UIWindow *keyboardWindow = nil;for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {if (![[testWindow class] isEqual:[UIWindow class]]) {键盘窗口 = 测试窗口;休息;}}//定位 UIWebFormView.for (UIView *possibleFormView in [keyboardWindow subviews]) {//iOS 5 将 UIWebFormView 粘贴在 UIPeripheralHostView 中.if ([[possibleFormView 描述] rangeOfString:@"UIPeripheralHostView"].location != NSNotFound) {for (UIView *subviewWhichIsPossibleFormView in [possibleFormView subviews]) {if ([[subviewWhichIsPossibleFormView 描述] rangeOfString:@"UIWebFormAccessory"].location != NSNotFound) {[subviewWhichIsPossibleFormView removeFromSuperview];}}}}}
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 this link How do you remove the Next and Prev buttons from virtual keyboard in Sencha Touch / Phonegap application,
my problem is i want to remove this prev & next button from the keyboard, but i dont know how. Can some body help me?
thank you
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];
}
}
}
}
}
这篇关于如何从虚拟键盘IOS中删除上一个下一个按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从虚拟键盘IOS中删除上一个下一个按钮
基础教程推荐
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01