[WebView].getWebSettings().setBuiltInZoomControls(true);こんな感じで呼び出せばいい、というわけです。こうした設定用メソッドはたくさん用意されています。とりあえず、ざっと以下のようなものだけでも覚えておくとよいでしょう。
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
package jp.tuyano.sample; import android.app.Activity; import android.os.Bundle; import android.webkit.*; import android.widget.*; public class MySample extends Activity { public WebView webview01; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webview01 = (WebView)findViewById(R.id.WebView01); webview01.setWebViewClient(new WebViewClient(){ @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { view.loadData("ERROR: " + description,"text/plain","utf8"); } }); webview01.getSettings().setBuiltInZoomControls(true); webview01.getSettings().setJavaScriptEnabled(true); webview01.getSettings().setMinimumFontSize(12); webview01.getSettings().setSupportZoom(true); webview01.getSettings().setSaveFormData(true); webview01.getSettings().setSavePassword(true); webview01.loadUrl("http://www.google.com/"); } }
<< 前へ | 次へ >> |