PhoneGap Iphone应用程序,触摸板包含额外的酒吧 [英] PhoneGap Iphone Apps, Touch pad contains additional Bar
问题描述
我使用phoneGAP创建了ai手机应用程序。当我在我的ipod测试我的应用程序,有一个额外的酒吧,在触摸板的顶部(它包含按钮,如完成,上一个,下一个)。
I have created a i phone app using phoneGAP.When i tested my app in my ipod, there is a additional bar found at the top of touch pad(it contains buttons like Done,previous,next).But it is not found on the apps that created using objective C.Anybody know how i removed this bar.
感谢,
推荐答案
表单助手(prev,next,done)栏可以通过使用一个有点黑客但可行的解决方案删除。这当然假设你使用phonegap。
The form assistant (prev, next, done) bar can be removed by using a somewhat hacky but working solution. This of course assumes you use phonegap. It simply cannot be done in a regular web app / web page.
使用以下方法替换 MainViewController.m 的内容:
Replace the contents of your MainViewController.m with this:
#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 Iphone应用程序,触摸板包含额外的酒吧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!