Android Webview内容滚动在主滚动视图内启用

Android Webview内容滚动在主滚动视图内启用,android,webview,scroll,scrollview,nestedscrollview,Android,Webview,Scroll,Scrollview,Nestedscrollview,我正在创建一个应用程序,其中我需要将webview放入scrollview中。我正在使用NestedScrollview。另外,我想在webview中滚动内容 <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" a

我正在创建一个应用程序,其中我需要将webview放入scrollview中。我正在使用NestedScrollview。另外,我想在webview中滚动内容

 <android.support.v4.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fillViewport="true">
       <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp"
        android:fontFamily="@font/avenirnextltpro_regular"
        android:text="df"
        android:textColor="@color/black"
        android:textSize="@dimen/title_textsizeBig"
     />
   ......... other views like image, Button etc........
      <WebView
       android:id="@+id/webviewWalkscore"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_marginStart="8dp"
       android:layout_marginLeft="8dp"
       android:layout_marginTop="8dp"
       android:layout_marginEnd="8dp"
       android:layout_marginRight="8dp"
     />

    </android.support.v4.widget.NestedScrollView>
我的webview加载一个HTML,其中包含一些数据的map+列表。所以当我从网络上滚动列表时,它不起作用,一个外部滚动视图的滚动被滚动。我想要一个地图和列表都可以在webview中滚动

 <android.support.v4.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fillViewport="true">
       <TextView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp"
        android:fontFamily="@font/avenirnextltpro_regular"
        android:text="df"
        android:textColor="@color/black"
        android:textSize="@dimen/title_textsizeBig"
     />
   ......... other views like image, Button etc........
      <WebView
       android:id="@+id/webviewWalkscore"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_marginStart="8dp"
       android:layout_marginLeft="8dp"
       android:layout_marginTop="8dp"
       android:layout_marginEnd="8dp"
       android:layout_marginRight="8dp"
     />

    </android.support.v4.widget.NestedScrollView>

......... 其他视图,如图像、按钮等。。。。。。。。
在Java文件中,我为webview添加了此设置

    webview.getSettings().setJavaScriptEnabled(true);
    webview.getSettings().setGeolocationEnabled(true);
    webview.setVerticalScrollBarEnabled(true);
    webview.getSettings().setLoadWithOverviewMode(true);
    webview.getSettings().setUseWideViewPort(true);
    webview.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
    webview.setScrollContainer(true);
    webview.loadUrl("<url with map and list>")
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setGeolocationEnabled(true);
webview.setVerticalScrollBarEnabled(true);
webview.getSettings().setLoadWithOverview模式(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_列);
webview.setScrollContainer(true);
webview.loadUrl(“”)

尝试使用实现NestedScrollingParent2的自定义视图组布局,并将其放入webview和其中的其他视图中。并让webview实现NestedScrollingChild。在webview中,覆盖onTouch或intercepttouch。在父布局中,覆盖dispatchTouch事件。将触摸事件传递给webview,然后它将用于调用DispatchStartTestedScroll的动作移动。 访问此链接。试着从中得到一些想法。


尝试使用实现NestedScrollingParent2的自定义视图组布局,并将其放入webview和其中的其他视图中。并让webview实现NestedScrollingChild。在webview中,覆盖onTouch或intercepttouch。在父布局中,覆盖dispatchTouch事件。将触摸事件传递给webview,然后它将用于调用DispatchStartTestedScroll的动作移动。 访问此链接。试着从中得到一些想法。


WebView本身支持滚动。如果删除
NestedScrollView
,会发生什么?如果删除NestedScrollView,它仍然不工作。我尝试了Scrollview和NestedScrollView。我有更多的视图,所以需要滚动视图。WebView本身支持滚动。如果删除
NestedScrollView
,会发生什么?如果删除NestedScrollView,它仍然不工作。我尝试了Scrollview和NestedScrollView。我有更多的视图,所以需要滚动视图。