|
本人不太会用语言写出来,但最近项目希望android和ios一起开发。于是使用h5技术。
遇到的相关问题,记录下来以便大家去参考。
相比之下,jquerymobile与jqmobi都会拿在一起比较。
之前用了一天测试jquerymobile的效率,在中端机子里普遍速度慢,特别是button的反应。
甚至在高端机子里也是如此,还有过渡还出现白屏。当然白屏这种情况是可以优化。这方面不吐槽了
果断使用jqmobi.
大家使用jqmobi都是冲着其效率,方便开发,语法简单来的。在此说一下几个出现比较常见的问题。
1.虽然框架给我们带来了许多很炫的过渡效果。但对于中低端机子里也是存在着延迟卡的问题。
如果项目没有特定要求的话,尽量减少动画的过渡,当然如果认为用户体验差的,主要客户是高端设备的,果断忽略。
2.使用框架中对于不同的机子我们测试出现了各种问题。(测试最好从低端机开始,不要把APP放到高配置的设备上测试流畅就认为可以了。这个大家都懂。)对于android4.4的机子里,在 list/scroll滑动中会出现header或者footer隐藏并且会漏出一大片空白。此时要注意在android配置文件中是否设置了target="19"。
对于android4.4来说,其webView有了很大的更新。跟之前的版本有所不同。当然具体的上官方看文档。
If your app uses WebView...
Your app might behave differently when running on Android 4.4, especially when you update your app's targetSdkVersion to "19" or higher.
The code underlying the WebView class and related APIs has been upgraded to be based on a modern snapshot of the Chromium source code. This brings a variety of improvements for performance, support for new HTML5 features, and support for remote debugging of your WebView content. The scope of this upgrade means that if your app uses WebView, it's behavior may be impacted in some cases. Although known behavior changes are documented and mostly affect your app only when you update your app's targetSdkVersion to "19" or higher—the new WebView operates in "quirks mode" to provide some legacy functionality in apps that target API level 18 and lower—it's possible that your app depends on unknown behaviors from the previous version of WebView.
So if your existing app uses WebView, it's important that you test on Android 4.4 as soon as possible and consult Migrating to WebView in Android 4.4 for information about how your app might be affected when you update your targetSdkVersion to "19" or higher.
fyi. Got it to work properly by setting the android:targetSdkVersion="19" in the Android project Manifest.
My declaration in AndroidManifest.xml:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="19"/>
Gives me the proper header and footer
Cheers,
GM
如果在使用jqmobi以上情况,可以参考以上的设置,我在国内的各大相关jqmobi帖子没看过对此事件的处理。
分享一下,文笔不好。望见谅。
网址:https://forums.html5dev-software ... t=6026&start=10
|
|