2011-03-11 74 views
0

我已经创建了使用phoneGAP的ai手机应用程序。当我在我的ipod中测试我的应用程序时,在触摸板的顶部找到了一个额外的条(它包含像Done,previous ,下一个)。但它没有在使用Objective C创建的应用程序中找到。任何人都知道我是如何删除这个栏的。PhoneGap iPhone应用程序,触摸板包含额外的酒吧

谢谢,

+0

我也用PhoneGap的,但没有了这个问题。尝试使用PhoneGap网站的最新源代码创建一个新的PhoneGap项目,并按照关于如何设置PhoneGap Xcode项目的说明进行操作。 – 2011-03-11 13:02:41

+0

当我点击一个文本框,礼拜式垫会来,在垫的顶部有一个标签包含3个按钮(上一页,下一页和完成) – user232751 2011-03-11 13:26:13

+0

我想你的CSS有什么问题 – 2011-03-11 13:35:57

回答

1

形式助理(分组,接下来,完成)可以通过使用一个稍微哈克但工作溶液中除去巴。这当然假设你使用phonegap。它根本无法在常规的Web应用程序/网页中完成。

这个替换您MainViewController.m内容:

#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 
+0

这很有用,但是我在顶部看到一个灰色的酒吧你会让它消失吗? – RussellHarrower 2013-02-04 06:24:29

相关问题