Maintain WebView content scroll position on orientation change

前端 未结 8 762
隐瞒了意图╮
隐瞒了意图╮ 2020-12-23 02:04

The browsers in Android 2.3+ do a good job at maintaining the scrolled position of content on an orientation changed.

I\'m trying to achieve the same thing for a We

8条回答
  •  不思量自难忘°
    2020-12-23 02:14

    I used the partial solution described in the original post, but instead put the javascript snippet inside onPageStarted(), instead of onPageFinished(). Seems to work for me with no jumping.

    My use case is slightly different: I'm trying to keep the horizontal position after the user refreshes the page.

    But I've been able to use your solution and it works perfectly for me :)

提交回复
热议问题