2012-11-02 81 views

回答

1

防止「閃爍」的唯一真正方法是完全禁用jQuery Mobile頁面轉換。在您的文檔的<head>,將此代碼:

// load jQuery 
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> 

// load your custom jQuery Mobile Defaults 
<script type="text/javascript" src="mobile/js/mobile-site-custom-jqm-defaults.js"></script> 

// load jQuery Mobile 
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> 

// load your scripts.js (your javascript & functions, etc.) 
<script type="text/javascript" src="mobile/js/script.js"></script> 

要禁用轉換,該mobile-site-custom-jqm-defaults.js文件裏,把這個代碼:

$(document).bind("mobileinit", function(){ 
    $.extend( $.mobile , { 
    defaultPageTransition: 'none' 
    }); 
}); 
+0

謝謝你你的時間。我只是嘗試過,但它不能解決問題! –

+0

嗨@亞當,你很近。而不是 defaultPageTransition:'none';我用 $ .mobile.defaultPageTransition ='none'; $ .mobile.defaultDialogTransition ='none'; 這相當大的解決了這個問題,如果不是完全的! –

0

我只在使用LimeJS框架時遇到了閃爍的轉換,他們克服了這一點,即在轉換之前將對象的不透明度設置爲0。並從那裏通過增加不透明度來實現過渡效果,但也許您的功能不支持它。

0

我有同樣的問題,因爲你,並解決它通過禁用硬件加速。

我這裏報道的:http://community.phonegap.com/nitobi/topics/disable_hardwareacceleratdisable_hardwareacceleration_on_android_ion_on_android

要長話短說,我的解決辦法是在AndroidManifest.xml中聲明:

<application android:hardwareAccelerated="false"/> 

參見:http://developer.android.com/guide/topics/manifest/application-element.html#hwaccel

HTH

+0

false,sorry(編輯) –

+0

嗨,感謝您的信息!這是聞所未聞的..肯定會給它一個鏡頭,並檢查性能! –

+0

不幸的是,它不支持API小於11(Android 3.0) http://developer.android.com/guide/topics/graphics/hardware-accel.html –