0
0

More than 1 year has passed since last update.

WebViewの設定について

Posted at

はじめに

今回はwebViewを触る機会があり少し調べたりもしたので、そこで調べて見つけたものを記事にします。

設定一覧

JavaScriptを有効にする

webView.settings.javaScriptEnabled = true

リンク先をブラウザにせず、WebView内でリンクさせる

webView.webViewClient = WebViewClient

スクロールバー領域を消す

webView.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY

または、

webView.setVerticalScrollbarOverlay(true)

ローカルのHTMLファイルを表示させる

val padh = "/data/index.html"
webView.loadUrl("file://$padh")

ローカルのファイルをwebViewに表示させるには http:// の代わりに file:// にします。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0