Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After closing fullscreen view, webview auto scrolls to the top #53

Open
SiarheiSm opened this issue Mar 1, 2020 · 3 comments
Open

After closing fullscreen view, webview auto scrolls to the top #53

SiarheiSm opened this issue Mar 1, 2020 · 3 comments

Comments

@SiarheiSm
Copy link

If video iframe belove some other content (text and ect) after closing fullscreen webview auto scrolls to the top of the page.
There is no issue if not apply FLAG_FULLSCREEN.
is there is a way to make it working with FLAG_FULLSCREEN?

@SiarheiSm
Copy link
Author

for me the issue was that webview have match_perent or wrap_content in height and after applying FLAG_FULLSCREEN webview lose it height.
solution was to set layoutParams.height = height before FLAG_FULLSCREEN

@TestereNecmi
Copy link

Can you share source code ?

@erengms
Copy link

erengms commented Aug 26, 2022

other solutions,

//when going fullscreen
int positionY = webView.getScrollY();

//when exiting fullscreen
 webView.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            webView.scrollTo(0, positionY);
                        }
                        // Delay the scrollTo to make it work
                    }, 800);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants