[英]WebView after closing fullscreen view, webview auto scrolls to top
I have webveiw
( with fullscreen support ) on the fragment.我在片段上有webveiw
(支持全屏) 。 The issue is when i close fullscreen the webview scrolls it position to top.问题是当我关闭全屏时,webview 会将其位置滚动到顶部。 Noticed:注意到:
FLAG_FULLSCREEN
flag (but i need to apply it to have real fullscreen)该问题仅在应用FLAG_FULLSCREEN
标志时出现(但我需要应用它才能获得真正的全屏)scrollTo
and ect此外,我还没有找到使用scrollTo
和 ect 等 webview 函数解决此问题的方法For me the issue was that webview
have match_perent or wrap_content
in height and after applying FLAG_FULLSCREEN
webview lose it height.对我来说,问题是webview
在高度上有match_perent or wrap_content
并且在应用FLAG_FULLSCREEN
webview 后失去它的高度。 solution was to set layoutParams.height = height
before set FLAG_FULLSCREEN
解决方案是在设置layoutParams.height = height
之前设置FLAG_FULLSCREEN
layoutParams.height = height
so, in this case "layoutParams.height" - layout height settings, "height" - current view height因此,在这种情况下,“layoutParams.height” - 布局高度设置,“height” - 当前视图高度
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.