I am creating one app in which i have a requirement of put webview inside scrollview..I am using NestedScrollview. Also, i want to scroll content inside webview.
My webview load one HTML which have map + list of some data. So when i scroll list from web it doesn't work and a scroll of outer Scrollview gets scrolled. I want a map and list both scrollable inside 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>
In Java file i have added this settings for 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>")