Question

My pager has one webview inside each fragment. The webviews themselves don't scroll, i.e. their content fit entirely in them.

The problem is the scrolling of the pager doesn't behave as expected. The webview content only follows the scrolling when going through the right edge of the screen (i.e. moving out/in to/from the right). When a webview is going through the left edge though it's content stays still (so that it looks like the next page is sliding over it, like cards).

I tried having other components (TextView, ImageView) along with the WebView on each page. They all slide normally while the WebView content keeps getting stuck on the left.

Is this a known problem? Is there a workaround?

Was it helpful?

Solution

Turns out the issue was CSS related. I had "position:fixed" on all web content. After changing it to "absolute" the problem was solved.

In my point of view it's still an unexpected behavior, because "fixed" is supposed to position things relative to the browser window. What is expected is that, as the webview is scrolled left, the "browser window" moves past the device screen.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top