我有一个Webview在我的应用程序中加载静态HTML内容。
问题是,当我点击链接或嵌入式内容(推文、YouTube视频)时,webview会向上滚动回到顶部。
这似乎是一个JS问题,如此处所述。
我尝试使用NestedScrollView或一些参数技巧,例如在LinearLayout父元素中使用
这是我的XML:
问题是,当我点击链接或嵌入式内容(推文、YouTube视频)时,webview会向上滚动回到顶部。
这似乎是一个JS问题,如此处所述。
我尝试使用NestedScrollView或一些参数技巧,例如在LinearLayout父元素中使用
android:focusableInTouchMode="true"
但没有任何效果。这是我的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中防止这种行为发生?
谢谢!