简体   繁体   English

Phonegap + Android:禁用反弹并突出显示滚动效果

[英]Phonegap + Android: disable bounce and highlight effect on scrolling

I've started an Adroid project with Phonegap following this guide: http://docs.phonegap.com/en/2.0.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android 我按照本指南开始了一个带有Phonegap的Adroid项目: http ://docs.phonegap.com/en/2.0.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

There is an unpleasant effect when scrolling longer pages: a highlighting at the end of scrolling (covering header and footer) and a small bounce (which makes fixed position header and footer also bounce). 滚动较长页面时会产生令人不快的效果:滚动结束时突出显示(覆盖页眉和页脚)和小弹跳(使固定位置页眉和页脚也反弹)。

Is there a way to prevent both - bouncing and highlight - on Android using this implementation of Phonegap? 有没有办法在Android上使用Phonegap的这种实现来防止 - 弹跳和突出显示? I've seen solutions only for embedded WebView. 我见过仅适用于嵌入式WebView的解决方案。

Well you can add the following lines: 那么你可以添加以下行:

if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
    this.appView.setOverScrollMode(appView.OVER_SCROLL_NEVER);
}

to the onCreate method of your Java class that extends from DroidGap it should get rid of the highlight at least and maybe the bounce too. 对于从DroidGap扩展的Java类的onCreate方法,它应该至少消除突出显示,也可能反弹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM