Maintain WebView content scroll position on orientation change

前端 未结 8 758
隐瞒了意图╮
隐瞒了意图╮ 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条回答
  •  旧时难觅i
    2020-12-23 02:14

    The aspect change will most likely always cause the current location in your WebView to not be the right location to scroll to afterwards. You could be sneaky and determine the top most visible element in the WebView and after an orientation change implant an anchor at that point in the source and redirect the user to it...

提交回复
热议问题