1. 程式人生 > >android中動態載入webview,webview載入html資料,並且隱藏滾動條

android中動態載入webview,webview載入html資料,並且隱藏滾動條

 ScrollView layouts = (ScrollView) findViewById(R.id.web);

WebView webviews = new WebView(DtDetailActivity.this);
webviews.setVisibility(webviews.INVISIBLE);
webviews.setVerticalScrollBarEnabled(false);
webviews.setHorizontalScrollBarEnabled(false);

String datas="<h>ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd</h>";

webviews.loadDataWithBaseURL(null, datas, "text/html", "utf-8",
null);

layouts.addView(webviews);