I use a WebView to show a table. The table is too big for the screen so the user must scroll through the page. I want to show a fixed header which is always visible. Since the position:fixed is not working on most versions of the WebView, I implemented an alternative using the onScroll event and manually positioning the header.
The problem with this is that the onScroll event is only fired when the scrolling is finished. This means that if you scroll up the header will be scrolled too from top to bottom until you stop scrolling and then the event is fired and it is repositioned.
Anyone a better solution how to show this?
I use a WebView to show a table. The table is too big for
Share
My final solution is to use two webviews, one on top of the other. The upper one shows the header, the lower one the content. To solve horizontal scrolling, a background thread synchronizes the
scrollX-position of the header with this of the content webview. This thread runs as long as the user is touching the content webview or the last webview’sscrollX-position is different than the previous one. The latter is necessary because a user can swipe the content and then lift its finger. This works very well.