【问题标题】:Android webview not show full content (Bootstrap and jQuery)Android webview 不显示全部内容(Bootstrap 和 jQuery)
【发布时间】:2017-08-08 11:17:51
【问题描述】:

在我的 mobil yandex 或 chrome 浏览器上显示此页面的全部内容 https://www.sbm.org.tr/tr/OnlineIslemler/Sayfalar/TrafikPoliceSorgula.aspx 但我的 webview 没有显示完整的内容。

这是我的代码

 public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView mWebView = (WebView) findViewById(R.id.webview);

        mWebView = (WebView) findViewById(R.id.webview);

        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.getSettings().setDomStorageEnabled(true);

         mWebView.setWebChromeClient(new WebChromeClient());
        mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
        mWebView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);


        mWebView.loadUrl("https://www.sbm.org.tr/tr/OnlineIslemler/Sayfalar/TrafikPoliceSorgula.aspx");

      /*  final ProgressDialog progress = ProgressDialog.show(this, "Sayfa", "Yükleniyor....", true);
        progress.show();
        mWebView.setWebViewClient(new WebViewClient() {

            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                Toast.makeText(getApplicationContext(), "Sayfa yüklendi", Toast.LENGTH_SHORT).show();
                progress.dismiss(); 
            } `

            public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
                Toast.makeText(getApplicationContext(), "Bir hata oluştu", Toast.LENGTH_SHORT).show();
                progress.dismiss();
            }
        });


*/
    }
}

【问题讨论】:

    标签: android jquery webview


    【解决方案1】:

    Webview 具有概览模式。欲了解更多信息,请参阅setLoadWithOverviewMode

    settings.setUseWideViewPort(true);
    settings.setLoadWithOverviewMode(true);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多