android.webkit.WebView.setScrollbarFadingEnabled()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(236)

本文整理了Java中android.webkit.WebView.setScrollbarFadingEnabled()方法的一些代码示例,展示了WebView.setScrollbarFadingEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.setScrollbarFadingEnabled()方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:setScrollbarFadingEnabled

WebView.setScrollbarFadingEnabled介绍

暂无

代码示例

代码示例来源:origin: ankidroid/Anki-Android

webView.setScrollbarFadingEnabled(true);
Timber.d("Focusable = %s, Focusable in touch mode = %s", webView.isFocusable(), webView.isFocusableInTouchMode());

代码示例来源:origin: sunfusheng/GlideImageView

private void initWebViewSettings() {
  WebSettings settings = webView.getSettings();
  settings.setJavaScriptEnabled(true); // 默认false,设置true后我们才能在WebView里与我们的JS代码进行交互
  settings.setJavaScriptCanOpenWindowsAutomatically(true); // 设置JS是否可以打开WebView新窗口
  settings.setSupportZoom(true); // 支持缩放
  settings.setBuiltInZoomControls(true); // 支持手势缩放
  settings.setDisplayZoomControls(false); // 不显示缩放按钮
  settings.setDatabaseEnabled(true);
  settings.setSaveFormData(true);
  settings.setDomStorageEnabled(true);
  settings.setGeolocationEnabled(true);
  settings.setAppCacheEnabled(true);
  settings.setUseWideViewPort(true); // 将图片调整到适合WebView的大小
  settings.setLoadWithOverviewMode(true); // 自适应屏幕
  webView.setHorizontalScrollBarEnabled(false);
  webView.setScrollbarFadingEnabled(true);
  webView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
  webView.setOverScrollMode(View.OVER_SCROLL_NEVER); // 取消WebView中滚动或拖动到顶部、底部时的阴影
}

代码示例来源:origin: stackoverflow.com

public void OpenUrl() {         

  private WebView View;
  View = (WebView) WebDialog.findViewById(R.id.ticketline);  
  View.setWebViewClient(new WebConn());
  View.setScrollbarFadingEnabled(true);  
  View.setHorizontalScrollBarEnabled(false);  
  View.getSettings().setJavaScriptEnabled(true);
  View.loadUrl("url to be loaded goes here");

  getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit();
  WebDialog.show();
}

代码示例来源:origin: stackoverflow.com

WebView webView;
String webViewUrl = "http://www.google.com";
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(false);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setPluginState(PluginState.ON);
webView.getSettings().setSupportZoom(true);
webView.loadUrl(webViewUrl);

代码示例来源:origin: stackoverflow.com

WebView mWebView = new WebView(context);
   mWebView.setWebViewClient(new WebClicent());
   mWebView.setScrollbarFadingEnabled(false);
   mWebView.setHorizontalScrollBarEnabled(true);
   mWebView.setWebViewClient(new MyWebViewClient());
   mWebView.getSettings().setUseWideViewPort(true);

代码示例来源:origin: stackoverflow.com

WebView web;
  web = (WebView) findViewById(R.id.webkit);
  web.setWebViewClient(new Callback());
  web.getSettings().setJavaScriptEnabled(true);
  web.getSettings().setLoadWithOverviewMode(true);
  web.getSettings().setUseWideViewPort(true);
  web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
  web.setScrollbarFadingEnabled(false);

代码示例来源:origin: stackoverflow.com

private WebView webView;

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.web);

    webView = (WebView) findViewById(R.id.web_view);
    webView.setInitialScale(1);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setLoadWithOverviewMode(true);
    webView.getSettings().setUseWideViewPort(true);
    webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    webView.setScrollbarFadingEnabled(false);
    webView.loadUrl("http://www.youtube.com");

  }

}

代码示例来源:origin: stackoverflow.com

public class WebWrapperActivity extends Activity {
  private WebView _webView;

  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.web_wrapper_activity_layout);

    init();
  }

  private void init() {
    _webView = (WebView) findViewById(R.id.web_wrapper_activity_web_view);
    _webView.setScrollbarFadingEnabled(true);
    _webView.getSettings().setLoadsImagesAutomatically(true);
    _webView.getSettings().setJavaScriptEnabled(true);

    _webView.getSettings().setAllowFileAccess(true);
    _webView.getSettings().setSavePassword(false);
    _webView.getSettings().setPluginState(WebSettings.PluginState.ON);

    _webView.loadUrl(“http://www.google.com”);
  }

  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    _webView.saveState(outState);
  }
}

代码示例来源:origin: stackoverflow.com

mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setAllowContentAccess(true);
mWebView.setScrollbarFadingEnabled(false);
mWebView.setWebViewClient(new WebViewClient() {
  @Override

代码示例来源:origin: stackoverflow.com

webView.getSettings().setDisplayZoomControls(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(false);
if (!filePath.startsWith("file://")) {
  filePath = "file://" + filePath;

代码示例来源:origin: stackoverflow.com

mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setAllowContentAccess(true);
mWebView.setScrollbarFadingEnabled(false);
mWebView.setWebViewClient(new WebViewClient() {
  @Override

代码示例来源:origin: stackoverflow.com

m_WebView.getSettings().setUseWideViewPort(true);
m_WebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
m_WebView.setScrollbarFadingEnabled(false);         
m_WebView.setWebViewClient(new WebViewController());
m_WebView.loadUrl(m_SelectedLink);

代码示例来源:origin: stackoverflow.com

webView.setInitialScale(60);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
webView.setScrollbarFadingEnabled(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);

代码示例来源:origin: stackoverflow.com

webView.getSettings().setPluginState(PluginState.ON);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(false);

代码示例来源:origin: stackoverflow.com

WebView webView = (WebView) findViewById(R.id.your_webview);

String html = "<html><head><title>A title</title></head><body bgcolor=\"#000000\"><img src=\"" + url + "\"></body></html>";

WebSettings webSettings = webView.getSettings();
webSettings.setBuiltInZoomControls(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setSupportZoom(true);   
webSettings.setUseWideViewPort(true);

webView.setScrollbarFadingEnabled(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.loadDataWithBaseURL("fake://fake.com", html, "text/html", "UTF-8", null);

代码示例来源:origin: vihuela/RAD

public void initWV(final WebView webView) {
  webView.setScrollbarFadingEnabled(true);

代码示例来源:origin: NianguoWang/ZhihuReader-master

webView.setScrollbarFadingEnabled(true);

代码示例来源:origin: martykan/webTube

public void setUpWebview() {
  // To save login info
  CookieHelper.acceptCookies(webView, true);
  // Some settings
  WebSettings webSettings = webView.getSettings();
  webSettings.setJavaScriptEnabled(true);
  webSettings.setJavaScriptCanOpenWindowsAutomatically(false);
  webSettings.setAllowFileAccess(false);
  webSettings.setDatabaseEnabled(true);
  String cachePath = mApplicationContext
      .getDir("cache", Context.MODE_PRIVATE).getPath();
  webSettings.setAppCachePath(cachePath);
  webSettings.setAllowFileAccess(true);
  webSettings.setAppCacheEnabled(true);
  webSettings.setDomStorageEnabled(true);
  webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
  webView.setHorizontalScrollBarEnabled(false);
  webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
  webView.setBackgroundColor(Color.WHITE);
  webView.setScrollbarFadingEnabled(true);
  webView.setNetworkAvailable(true);
}

代码示例来源:origin: sunfusheng/Gank.IO

private void initWebViewSettings() {
  WebSettings settings = webView.getSettings();
  settings.setJavaScriptEnabled(true); // 默认false,设置true后我们才能在WebView里与我们的JS代码进行交互
  settings.setJavaScriptCanOpenWindowsAutomatically(true); // 设置JS是否可以打开WebView新窗口
  settings.setSupportZoom(true); // 支持缩放
  settings.setBuiltInZoomControls(true); // 支持手势缩放
  settings.setDisplayZoomControls(false); // 不显示缩放按钮
  settings.setDatabaseEnabled(true);
  settings.setSaveFormData(true);
  settings.setDomStorageEnabled(true);
  settings.setGeolocationEnabled(true);
  settings.setAppCacheEnabled(true);
  settings.setUseWideViewPort(true); // 将图片调整到适合WebView的大小
  settings.setLoadWithOverviewMode(true); // 自适应屏幕
  webView.setHorizontalScrollBarEnabled(false);
  webView.setScrollbarFadingEnabled(true);
  webView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
  webView.setOverScrollMode(View.OVER_SCROLL_NEVER); // 取消WebView中滚动或拖动到顶部、底部时的阴影
}

代码示例来源:origin: sunfusheng/DroidVR

private void initWebViewSettings() {
  WebSettings settings = webView.getSettings();
  settings.setJavaScriptEnabled(true); // 默认false,设置true后我们才能在WebView里与我们的JS代码进行交互
  settings.setJavaScriptCanOpenWindowsAutomatically(true); // 设置JS是否可以打开WebView新窗口
  settings.setSupportZoom(true); // 支持缩放
  settings.setBuiltInZoomControls(true); // 支持手势缩放
  settings.setDisplayZoomControls(false); // 不显示缩放按钮
  settings.setDatabaseEnabled(true);
  settings.setSaveFormData(true);
  settings.setDomStorageEnabled(true);
  settings.setGeolocationEnabled(true);
  settings.setAppCacheEnabled(true);
  settings.setUseWideViewPort(true); // 将图片调整到适合WebView的大小
  settings.setLoadWithOverviewMode(true); // 自适应屏幕
  webView.setHorizontalScrollBarEnabled(false);
  webView.setScrollbarFadingEnabled(true);
  webView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
  webView.setOverScrollMode(View.OVER_SCROLL_NEVER); // 取消WebView中滚动或拖动到顶部、底部时的阴影
}

相关文章

WebView类方法