如何在用Phonegap编写的iPhone应用程序中禁用“摇动撤消”?

时间:2010-09-28 09:49:18

标签: iphone plist cordova

The only thing I've found是你必须在plist文件中将UIApplicationSupportsShakeToEdit设置为false,但它对我不起作用。

1 个答案:

答案 0 :(得分:2)

我插入了这一行:

[UIApplication sharedApplication].applicationSupportsShakeToEdit = NO;

在webViewDidFinishLoad课程中,它为我创造了奇迹。

转到MainViewController.m并将webViewDidFinishLoad更改为如下所示:

- (void)webViewDidFinishLoad:(UIWebView*)theWebView
{
    // Black base color for background matches the native apps
    theWebView.backgroundColor = [UIColor blackColor];

[UIApplication sharedApplication].applicationSupportsShakeToEdit = NO;

    return [super webViewDidFinishLoad:theWebView];
}