【发布时间】:2017-12-05 00:28:12
【问题描述】:
我有一个 Webview 在我的应用程序中加载静态 html 内容。
问题是,当我点击链接或嵌入内容时(推文、youtube 视频),webview 正在滚动回顶部。
看起来像here提到的JS问题
我尝试使用 NestedScrollView 或一些带有参数的技巧,例如
android:focusableInTouchMode="true"
在 LinearLayout 父级中,但没有任何作用
这是我的 xml:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/article_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.v4.widget.NestedScrollView>
它将在回收站视图中。
我的问题是:
有没有办法在 webview 设置或 xml 中防止这种行为?
谢谢!
【问题讨论】:
-
嗨,保罗,您找到解决方案了吗?
-
嗨,保罗,您找到解决方案了吗?
标签: android webview scroll android-recyclerview