簡體   English   中英

輕按狀態欄時,Phonegap Xcode iOS應用程序崩潰

[英]Phonegap Xcode iOS app crashes when status bar is tapped

我將Xcode 4.3.1與Phonegap 1.4.1結合使用來構建iPhone應用程序。 每當我點擊狀態欄滾動到頂部時,應用程序就會崩潰並顯示EXC_BAD_ACCESS錯誤。

我已嘗試實施一些建議,例如this

我還嘗試添加以下代碼的變體:

[[[theWebView subviews] objectAtIndex:0] setScrollsToTop:NO];

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

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

在AppDelegate.m中

但是,我一直無法解決問題。 我主要關心的是阻止應用程序崩潰,任何見解將不勝感激。

我正在使用cordova 1.7並遇到相同的問題。 我找到了解決方法。 您需要通過注釋掉由phonegap注入以與本機端進行通信的無形iframe的創建來修補phonegap。 實際上,此iframe會導致各種渲染問題,而不僅僅是狀態欄問題:

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

完成上述更改后,我沒有發現任何副作用。 但是,我知道有人抱怨某些插件停止工作,例如Google Analytics(分析)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM