Rana Asad:
En vista web cuando me desplazo la pequeña página mordió entonces desplazarse automáticamente en algunas páginas no todas las páginas, pero en algunas pages.Why esto suceda y para qué sirve solución aquí es el código XML
<android.support.design.widget.CoordinatorLayout android:id="@+id/nonVideoLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
<WebView
android:id="@+id/webView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout>
Aquí está mi código puede comprobar esto
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view);
bindLayout();
mySwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
webView.reload();
}
});
CookieManager.getInstance().setCookie(url, cookie);
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
ProgressDialogHelper.showProgress(WebViewActivity.this);
webView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, final String url) {
mySwipeRefreshLayout.setRefreshing(false);
}
});
webView.loadUrl(url);
}
Aquí está mi código java que establece la cookie también a la página we y yo también establece tipo de capa. Yo busco que todo el mundo dice al conjunto de tipo de capa, entonces este problema resuelto pero no resuelto.
Momen Zaqout:
prueba esto
final WebSettings settings = mWebView.getSettings();
settings.setDomStorageEnabled(true);
settings.setJavaScriptEnabled(true);
mWebView.setVerticalScrollBarEnabled(false);