Phonegap Xcode iOS app crashes when status bar is tapped

匿名 (未验证) 提交于 2019-12-03 02:38:01

问题:

I'm using Xcode 4.3.1 with Phonegap 1.4.1 to build an iPhone app. Whenever I tap the status bar to scroll to top, the app crashes with an EXC_BAD_ACCESS error.

I've tried implementing a number of suggestions such as this .

I've also tried adding variations of the below code:

[[[theWebView subviews] objectAtIndex:0] setScrollsToTop:NO];  ((UIScrollView*)[theWebView.subviews objectAtIndex:0]).scrollsToTop = NO;

to the

- (void) webViewDidFinishLoad:(UIWebView*) theWebView  {  ... }

within the AppDelegate.m

However, I've have been unable to resolve the issue. My main concern is to stop the app form crashing, any insight would be greatly appreciated.

回答1:

I am using cordova 1.7 and have the same problem. I found a workaround though. You need to patch phonegap by commenting out the creation of invsible iframe which is injected by phonegap to communicate with the native side. In fact, this iframe causes all kinds of rendering issues, not only the status bar problem:

if (cordova.commandQueue.length == 1 && !cordova.commandQueueFlushing) { //        if (!gapBridge) { //            createGapBridge(); //        } //        gapBridge.src = "gap://ready";     location = "gap://ready"; }

I didn't find any side effects after I've made the above change. However, I know people complain that some plugins stopped working, e.g. google analytics.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!