【发布时间】:2018-04-11 13:51:13
【问题描述】:
我有一个 NestedScrollView,里面有一个 WebView。 WebView 包含一个带有锚点的 HTML 文件,这些锚点链接到同一个文件但位置不同(想象一下“菜单”和“内容”容器。当您单击菜单项时,“内容”中的相应部分应出现在屏幕上) .
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/svNested"
android:layout_height="match_parent"
tools:showIn="@layout/activity_single"
android:background="@color/colorPrimary">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.v4.widget.NestedScrollView>
加载数据:
webView?.loadDataWithBaseURL(null, htmlContent, "text/html", "UTF-8", null)
问题是这些锚点没有按预期工作。
【问题讨论】:
-
你找到解决方案了吗?
-
不,抱歉。但那是 3 年。以前。
标签: android html webview android-nestedscrollview