WebView使用踩坑

Cannot read property 'getItem' of null"

Uncaught TypeError: Cannot read property 'getItem' of null

WebSettings settings = mWebView.getSettings();
settings.setDomStorageEnabled(true);//開啓DOM

 

 

settings.setDisplayZoomControls(false); //隱藏webview縮放按鈕

 

//設置加載進來的頁面自適應手機屏幕 
 settings.setUseWideViewPort(true); 
 settings.setLoadWithOverviewMode(true); 
第一個方法設置webview推薦使用的窗口,設置爲true。第二個方法是設置webview加載的頁面的模式,也設置爲true。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章