<i id='CTvxz'><tr id='CTvxz'><dt id='CTvxz'><q id='CTvxz'><span id='CTvxz'><b id='CTvxz'><form id='CTvxz'><ins id='CTvxz'></ins><ul id='CTvxz'></ul><sub id='CTvxz'></sub></form><legend id='CTvxz'></legend><bdo id='CTvxz'><pre id='CTvxz'><center id='CTvxz'></center></pre></bdo></b><th id='CTvxz'></th></span></q></dt></tr></i><div id='CTvxz'><tfoot id='CTvxz'></tfoot><dl id='CTvxz'><fieldset id='CTvxz'></fieldset></dl></div>

<tfoot id='CTvxz'></tfoot>
    • <bdo id='CTvxz'></bdo><ul id='CTvxz'></ul>

        <small id='CTvxz'></small><noframes id='CTvxz'>

      1. <legend id='CTvxz'><style id='CTvxz'><dir id='CTvxz'><q id='CTvxz'></q></dir></style></legend>
      2. 如何将此脚本安装到 iOS 的 PhoneGap 中

        How do I install this script into PhoneGap for iOS(如何将此脚本安装到 iOS 的 PhoneGap 中)
        <i id='76KBZ'><tr id='76KBZ'><dt id='76KBZ'><q id='76KBZ'><span id='76KBZ'><b id='76KBZ'><form id='76KBZ'><ins id='76KBZ'></ins><ul id='76KBZ'></ul><sub id='76KBZ'></sub></form><legend id='76KBZ'></legend><bdo id='76KBZ'><pre id='76KBZ'><center id='76KBZ'></center></pre></bdo></b><th id='76KBZ'></th></span></q></dt></tr></i><div id='76KBZ'><tfoot id='76KBZ'></tfoot><dl id='76KBZ'><fieldset id='76KBZ'></fieldset></dl></div>
      3. <tfoot id='76KBZ'></tfoot>

          <small id='76KBZ'></small><noframes id='76KBZ'>

            • <bdo id='76KBZ'></bdo><ul id='76KBZ'></ul>

                  <tbody id='76KBZ'></tbody>

                <legend id='76KBZ'><style id='76KBZ'><dir id='76KBZ'><q id='76KBZ'></q></dir></style></legend>

                • 本文介绍了如何将此脚本安装到 iOS 的 PhoneGap 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我不懂任何 Objective-C,这就是我使用 PhoneGap 创建 iOS 应用程序的原因.iOS 版 PhoneGap 有一个很大的缺陷.键盘经常有表单助手(下一个"、上一个"和完成"按钮.)网上关于如何摆脱这个的信息很少,所有关于它的 Stackoverflow 问题都说它实际上是不可能的.但过了一会儿,我偶然发现了这个教程.底部段落告诉你如何去做.它工作正常,我下载并测试了完成的应用程序.

                  I don't know any Objective-C, that is why I'm using PhoneGap to create an iOS app. There is a big flaw in PhoneGap for iOS. The keyboard constantly has the form assistant (the 'next', 'previous' and 'done' buttons.) There is very little information on the web on how to get rid of this, all of the Stackoverflow questions about it said it was practically impossible. But after a while I stumbled upon this tutorial. The bottom paragraph tells you how to do it. And it works, I downloaded and tested the finished app.

                  但由于我几乎不知道如何在 Xcode 或 Objective-C 中做任何事情,所以我不知道这两段代码进入什么文件,他在教程中没有说.

                  But since I have no idea how to do almost anything in Xcode, or in Objective-C, I have no idea what files the two sections of code go into, he doesn't say in the tutorial.

                  谁能告诉我它在 PhoneGap 应用程序文件中的哪个位置?非常感谢,这一直困扰着我一整天.

                  Can anyone tell me where in the PhoneGap apps files it goes? I'd appreciate it massively, this has been bugging me all day.

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

                  还有这个

                  RichTextEditorViewController *viewController = [[RichTextEditorViewController alloc] initWithNibName:@"RichTextEditorViewController" bundle:nil];
                  self.viewController = [[UINavigationController alloc] initWithRootViewController:viewController];
                  

                  还有这个

                  - (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 开发人员,但需要使用 phonegap 来降低多平台开发的成本.

                  I have come across the need to do this myself. I am an IOS developer, but needed to use phonegap to keep costs down for multiplatform dev.

                  无论如何,我修复了您的代码.因为,我想,你不想花时间学习 obj-c,你只需要将 MainViewController.m 的内容替换为以下内容:

                  Anyway, i fixed your code. As, i guess, you dont want to spend your time learning obj-c, you just need to replace the contents of your MainViewController.m with the following:

                  #import "MainViewController.h"
                  
                  @implementation MainViewController
                  
                  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
                  {
                      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
                      if (self) {
                          // Custom initialization
                          [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
                      }
                      return self;
                  }
                  
                  - (void)didReceiveMemoryWarning
                  {
                      // Releases the view if it doesn't have a superview.
                      [super didReceiveMemoryWarning];
                  
                      // Release any cached data, images, etc that aren't in use.
                  }
                  
                  #pragma mark - View lifecycle
                  
                  - (void)viewDidLoad
                  {
                      [super viewDidLoad];
                      // Do any additional setup after loading the view from its nib.
                  }
                  
                  - (void)viewDidUnload
                  {
                      [super viewDidUnload];
                      // Release any retained subviews of the main view.
                      // e.g. self.myOutlet = nil;
                  }
                  
                  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
                  {
                      // Return YES for supported orientations
                      return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
                  }
                  
                  - (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];
                                  }
                              }
                          }
                      }
                  }
                  
                  - (void)keyboardWillShow:(NSNotification*) notification {
                      // remove the bar in the next runloop (not actually created at this point)
                      [self performSelector:@selector(removeBar) withObject:nil afterDelay:0];
                  }
                  
                  @end
                  

                  作为警告,这是一个有点笨拙的解决方案(但使用 phonegap 也是如此!),并且可能会在未来的 iOS 版本中中断.但我想我们会解决这个问题......

                  As a word of warning, this is a bit of a hacky solution (but then so is using phonegap!), and may break in future versions of iOS. But i guess we fix that when it comes to it...

                  这篇关于如何将此脚本安装到 iOS 的 PhoneGap 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  EAAccessory/EASession teardown during background(EAAccessory/EASession 在后台拆除)
                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  How to get indexPath.row of tableView which is currently being displayed?(如何获取当前正在显示的 tableView 的 indexPath.row?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)
                      <bdo id='FuJEc'></bdo><ul id='FuJEc'></ul>

                          <tbody id='FuJEc'></tbody>
                      1. <i id='FuJEc'><tr id='FuJEc'><dt id='FuJEc'><q id='FuJEc'><span id='FuJEc'><b id='FuJEc'><form id='FuJEc'><ins id='FuJEc'></ins><ul id='FuJEc'></ul><sub id='FuJEc'></sub></form><legend id='FuJEc'></legend><bdo id='FuJEc'><pre id='FuJEc'><center id='FuJEc'></center></pre></bdo></b><th id='FuJEc'></th></span></q></dt></tr></i><div id='FuJEc'><tfoot id='FuJEc'></tfoot><dl id='FuJEc'><fieldset id='FuJEc'></fieldset></dl></div>
                      2. <tfoot id='FuJEc'></tfoot>

                          <small id='FuJEc'></small><noframes id='FuJEc'>

                        • <legend id='FuJEc'><style id='FuJEc'><dir id='FuJEc'><q id='FuJEc'></q></dir></style></legend>