简体   繁体   English

切换到下一页时,ViewPager跳到一半页面

[英]ViewPager jumps half the page when switching to next page

I'm using a ViewPager with android 3.+ to create a series of articles. 我在Android 3. +上使用ViewPager来创建一系列文章。 On each separate page, I have a scrollView which contains the whole article, plus images if there so happens to be one in the feed, all contained within a webView . 在每个单独的页面上,我有一个scrollView ,其中包含整篇文章,以及图像,如果恰好是Feed中的一个,都包含在webView

I've ran into a problem where upon flinging to the next page, the scrollView or webView , I'm not really sure, will scroll down half the page without you doing anything. 我遇到了一个问题,当我scrollView ,我不确定滚动scrollViewwebView是否会向下滚动一半页面,而无需执行任何操作。 When this happens once, it continues to happen on each following page. 当这发生一次时,它将继续发生在每个后续页面上。

Any ideas? 有任何想法吗?

** EDIT ** **编辑**

Answer: Disable selectable links within WebView 答: 禁用WebView中的可选链接

I found the correct problem with another issue I was having, and it answers this question. 我找到了另一个问题的正确问题,它回答了这个问题。 Can be viewed here: Disable selectable links within WebView 可以在这里查看: 禁用WebView中的可选链接

pseudocode: 伪代码:

@Override
onPageSwitch() {
    contentView.setScroll(0);

Something like this perhaps as a workaround? 这样的事可能是一种解决方法吗?

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

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